当前位置: 首页>>代码示例>>Java>>正文


Java Session.move方法代码示例

本文整理汇总了Java中javax.jcr.Session.move方法的典型用法代码示例。如果您正苦于以下问题:Java Session.move方法的具体用法?Java Session.move怎么用?Java Session.move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.jcr.Session的用法示例。


在下文中一共展示了Session.move方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reprocessNotification

import javax.jcr.Session; //导入方法依赖的package包/类
public void reprocessNotification(CardNotification cardNotification, String type) throws Exception {
	ObjectContentManager ocm = ocmFactory.getOcm();
	try {

		final Session session = ocm.getSession();			
		final String source = cardNotification.getPath();
		final String destination = String.format(URI.NOTIFICATIONS_TYPE_ID_URI, type, cardNotification.getId());
		
		session.move(source, destination);
		ocm.save();
		this.jmsTemplate.convertAndSend(cardNotification);
		
		LOG.info("Successfully Moved Notification id:'" + 
				cardNotification.getId() + "' type:'" + 
				type + "' for reprocessing.");
		
	} finally {
		ocm.logout();
	}
}
 
开发者ID:cheetah100,项目名称:gravity,代码行数:21,代码来源:NotificationController.java

示例2: dismisAlert

import javax.jcr.Session; //导入方法依赖的package包/类
@PreAuthorize("hasPermission(#boardId, 'BOARD', 'WRITE,ADMIN')")
@RequestMapping(value = "/{cardId}/alerts/{alertId}/dismiss", method=RequestMethod.GET)
public @ResponseBody void dismisAlert(@PathVariable String boardId, 
									  			  @PathVariable String phaseId, 
									  			  @PathVariable String cardId,@PathVariable String alertId) throws Exception {
	ObjectContentManager ocm = ocmFactory.getOcm();
	try {
		Session session = ocm.getSession();
		listTools.ensurePresence(String.format(URI.ALERTS_URI, boardId, phaseId,cardId,alertId), "alerts", session);
		String source = String.format(URI.ALERTS_URI, boardId, phaseId, cardId, alertId); 
		String destination = String.format(URI.HISTORY_URI, boardId, phaseId, cardId,alertId);
		session.move(source, destination);
		storeCardEvent(URI.HISTORY_URI,"Moving Alert " + alertId + " to " + "History " + alertId , 
				boardId, phaseId, cardId, "info", "dismiss-alert", ocm);
		ocm.save();
	} finally {
		ocm.logout();
	}
}
 
开发者ID:cheetah100,项目名称:gravity,代码行数:20,代码来源:CardController.java

示例3: moveNotificationToCard

import javax.jcr.Session; //导入方法依赖的package包/类
@RequestMapping(value = "/{type}/{notificationId}/moveToCard/{boardId}/{cardId}", method=RequestMethod.GET)
public @ResponseBody void moveNotificationToCard(@PathVariable String type, 
												 @PathVariable String notificationId, 
												 @PathVariable String boardId, 
												 @PathVariable String cardId) throws Exception {
	
	ObjectContentManager ocm = ocmFactory.getOcm();
	try { 
		
		if (doesNotificationTypeExist(type,ocm)) {
			final Session session = ocm.getSession();
			
			final String source = String.format(URI.NOTIFICATIONS_TYPE_ID_URI, type, notificationId); 
			final Card card = this.cardTools.getCard(boardId, cardId, ocm);
			final String destination = String.format(URI.MOVE_NOTIFICATION_URI, card.getPath(), type, notificationId);
			
			listTools.ensurePresence(session, card.getPath(), NOTIFICATIONS, type);
			
			session.move(source, destination);
			ocm.save();
			
		} else {
			final String errMsg = "Failed to move Notification Id:'"+notificationId+"' Type:'"+type+"' to card:'"+cardId+"' on boardId:'"+boardId+"'.";
			LOG.error(errMsg);
			throw new IllegalArgumentException(errMsg);
		}
	} finally {
			ocm.logout();
	}
}
 
开发者ID:cheetah100,项目名称:gravity,代码行数:31,代码来源:NotificationController.java

示例4: moveCard

import javax.jcr.Session; //导入方法依赖的package包/类
@PreAuthorize("hasPermission(#boardId, 'BOARD', 'WRITE,ADMIN')")
@RequestMapping(value = "/{cardId}/move/{newPhaseId}", method=RequestMethod.GET)
public @ResponseBody Card moveCard(
	   @PathVariable String boardId, 
	   @PathVariable String phaseId,
	   @PathVariable String cardId,
	   @PathVariable String newPhaseId ) throws Exception {

	logger.info("Moving Card - card:"+ boardId + "/" + phaseId + "/" + cardId + " -> " + newPhaseId);
	ObjectContentManager ocm = ocmFactory.getOcm();
	Card card;
	try{	
		Session session = ocm.getSession();
		listTools.ensurePresence(String.format( URI.PHASES_URI, boardId, newPhaseId), "cards", session);
		String source = String.format(URI.CARDS_URI, boardId, phaseId, cardId); 
		String destination = String.format(URI.CARDS_URI, boardId, newPhaseId, cardId);
		session.move(source, destination);
		storeCardEvent(URI.HISTORY_URI,"Moving card from " + phaseId + " to " + newPhaseId,
				boardId, newPhaseId, cardId, "info", "move-" + newPhaseId, ocm);
		ocm.save();
		card = (Card) ocm.getObject(Card.class, destination);
		cardsLockCache.applyLockState(card);
		boardCache.incrementCardCount(boardId, phaseId, -1);
		boardCache.incrementCardCount(boardId, newPhaseId, 1);				
	} finally {
		ocm.logout();
	}
	return card;		
}
 
开发者ID:cheetah100,项目名称:gravity,代码行数:30,代码来源:CardController.java


注:本文中的javax.jcr.Session.move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。