本文整理匯總了Java中org.kuali.rice.kcb.bo.Message.setDeliveryType方法的典型用法代碼示例。如果您正苦於以下問題:Java Message.setDeliveryType方法的具體用法?Java Message.setDeliveryType怎麽用?Java Message.setDeliveryType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.kuali.rice.kcb.bo.Message
的用法示例。
在下文中一共展示了Message.setDeliveryType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testCreate
import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
@Test
public void testCreate() {
Message m = new Message();
m.setContent("test content 2");
m.setChannel("channel2");
m.setContentType("test content type 2");
m.setDeliveryType("test delivery type 2");
m.setRecipient("test recipient 2");
m.setTitle("test title 2");
m = messageService.saveMessage(m);
assertNotNull(m.getId());
Collection<Message> ms = messageService.getAllMessages();
assertNotNull(ms);
assertEquals(2, ms.size());
Message m2 = messageService.getMessage(m.getId());
assertNotNull(m2);
assertEqualsMD(m, m2);
Message m1 = new Message();
m1.setContent("a");
m1.setChannel("a");
m1.setContentType("a");
m1.setDeliveryType("a");
m1.setRecipient("a");
m1.setTitle("a");
// should allow more than one record with NULL origin id
messageService.saveMessage(m1);
}
示例2: getMessage1
import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
public static Message getMessage1() {
Message m= new Message();
m.setId(Long.valueOf(1));
m.setChannel("channel1");
m.setContent("test content 1");
m.setContentType("test content type 1");
m.setDeliveryType("test delivery type 1");
m.setRecipient("test recipient 1");
m.setTitle("test title 1");
return m;
}
示例3: testCreate
import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
@Test
@Override
public void testCreate() {
Message m = new Message();
m.setContent("test content 2");
m.setChannel("channel2");
m.setContentType("test content type 2");
m.setDeliveryType("test delivery type 2");
m.setRecipient("test recipient 2");
m.setTitle("test title 2");
messageService.saveMessage(m);
assertNotNull(m.getId());
Collection<Message> ms = messageService.getAllMessages();
assertNotNull(ms);
assertEquals(2, ms.size());
Message m2 = messageService.getMessage(m.getId());
assertNotNull(m2);
assertEqualsMD(m, m2);
Message m1 = new Message();
m1.setContent("a");
m1.setChannel("a");
m1.setContentType("a");
m1.setDeliveryType("a");
m1.setRecipient("a");
m1.setTitle("a");
// should allow more than one record with NULL origin id
messageService.saveMessage(m1);
}
示例4: deliver
import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
/**
* @see org.kuali.rice.kcb.service.MessagingService#deliver(org.kuali.rice.kcb.dto.MessageDTO)
*/
@Override
public Long deliver(MessageDTO message) throws MessageDeliveryException {
if (message == null) {
throw new RiceIllegalArgumentException("message is null");
}
Collection<String> delivererTypes = getDelivererTypesForUserAndChannel(message.getRecipient(), message.getChannel());
LOG.debug("Deliverer types for " + message.getRecipient() + "/" + message.getChannel() + ": " + delivererTypes.size());
if (delivererTypes.isEmpty()) {
// no deliverers configured? just skipp it
LOG.debug("No deliverers are configured for " + message.getRecipient() + "/" + message.getChannel());
return null;
}
Message m = new Message();
m.setTitle(message.getTitle());
m.setDeliveryType(message.getDeliveryType());
m.setChannel(message.getChannel());
m.setRecipient(message.getRecipient());
m.setContentType(message.getContentType());
m.setUrl(message.getUrl());
m.setContent(message.getContent());
m.setOriginId(message.getOriginId());
LOG.debug("saving message: " +m);
m = messageService.saveMessage(m);
for (String type: delivererTypes) {
MessageDelivery delivery = new MessageDelivery();
delivery.setDelivererTypeName(type);
delivery.setMessage(m);
// MessageDeliverer deliverer = delivererRegistry.getDeliverer(delivery);
// if (deliverer != null) {
// deliverer.deliverMessage(delivery);
// }
LOG.debug("saving messagedelivery: " +delivery);
messageDeliveryService.saveMessageDelivery(delivery);
}
LOG.debug("queuing job");
queueJob(MessageProcessingJob.Mode.DELIVER, m.getId(), null, null);
LOG.debug("returning");
return m.getId();
}
示例5: deliver
import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
/**
* @see org.kuali.rice.kcb.service.MessagingService#deliver(org.kuali.rice.kcb.dto.MessageDTO)
*/
@Override
public Long deliver(MessageDTO message) throws MessageDeliveryException {
if (message == null) {
throw new RiceIllegalArgumentException("message is null");
}
Collection<String> delivererTypes = getDelivererTypesForUserAndChannel(message.getRecipient(), message.getChannel());
LOG.debug("Deliverer types for " + message.getRecipient() + "/" + message.getChannel() + ": " + delivererTypes.size());
if (delivererTypes.isEmpty()) {
// no deliverers configured? just skipp it
LOG.debug("No deliverers are configured for " + message.getRecipient() + "/" + message.getChannel());
return null;
}
final Message m = new Message();
m.setTitle(message.getTitle());
m.setDeliveryType(message.getDeliveryType());
m.setChannel(message.getChannel());
m.setRecipient(message.getRecipient());
m.setContentType(message.getContentType());
m.setUrl(message.getUrl());
m.setContent(message.getContent());
m.setOriginId(message.getOriginId());
LOG.debug("saving message: " +m);
messageService.saveMessage(m);
for (String type: delivererTypes) {
MessageDelivery delivery = new MessageDelivery();
delivery.setDelivererTypeName(type);
delivery.setMessage(m);
// MessageDeliverer deliverer = delivererRegistry.getDeliverer(delivery);
// if (deliverer != null) {
// deliverer.deliverMessage(delivery);
// }
LOG.debug("saving messagedelivery: " +delivery);
messageDeliveryService.saveMessageDelivery(delivery);
}
LOG.debug("queuing job");
queueJob(MessageProcessingJob.Mode.DELIVER, m.getId(), null, null);
LOG.debug("returning");
return m.getId();
}