本文整理匯總了Java中org.kuali.rice.ken.bo.NotificationResponseBo類的典型用法代碼示例。如果您正苦於以下問題:Java NotificationResponseBo類的具體用法?Java NotificationResponseBo怎麽用?Java NotificationResponseBo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NotificationResponseBo類屬於org.kuali.rice.ken.bo包,在下文中一共展示了NotificationResponseBo類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sendNotification
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
/**
* This method is responsible for parsing out the notification message which is sent in as a String
* of XML. It calls the appropriate services to validate the message content, converts it to a BO,
* and then passes it to another service where its content and meta-data is validated and if successful, it
* is saved.
* @see org.kuali.rice.ken.service.NotificationService#sendNotification(java.lang.String)
*/
@Override
public NotificationResponseBo sendNotification(String notificationMessageAsXml) throws IOException, XmlException {
// try to parse out the XML with the message content service
NotificationBo notification = messageContentService.parseNotificationRequestMessage(notificationMessageAsXml);
// now call out to the meat of the notification sending - this will validate users, groups, producers, and save
return sendNotification(notification);
}
示例2: generateNotificationResponseMessage
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
/**
* This method will marshall out the NotificationResponse object as a String of XML, using XStream.
* @see org.kuali.rice.ken.service.NotificationMessageContentService#generateNotificationResponseMessage(org.kuali.rice.ken.bo.NotificationResponseBo)
*/
public String generateNotificationResponseMessage(NotificationResponseBo response) {
XStream xstream = new XStream(new DomDriver());
xstream.alias("response", NotificationResponseBo.class);
xstream.alias("status", String.class);
xstream.alias("message", String.class);
xstream.alias("notificationId", Long.class);
String xml = xstream.toXML(response);
return xml;
}
示例3: invoke
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
/**
* Actually invokes the sendNotification() service method. The KSB calls
* this.
* @see org.kuali.rice.ksb.messaging.service.KSBXMLService#invoke(java.lang.String)
*/
@Override
public NotificationResponse invoke(String message) {
if (StringUtils.isBlank(message)) {
throw new RiceIllegalArgumentException("xml is null or blank");
}
try {
NotificationResponseBo response = notificationService.sendNotification(message);
LOG.info(response.getMessage());
return NotificationResponseBo.to(response);
} catch (Exception e) {
throw new WorkflowRuntimeException(e);
}
}
示例4: sendNotification
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
@Override
public NotificationResponse sendNotification(Notification notification) {
if (null == notification) {
throw new RiceIllegalArgumentException("xml is null or blank");
}
try {
NotificationBo notificationBo = NotificationBo.from(notification);
NotificationResponseBo response = notificationService.sendNotification(notificationBo);
LOG.info(response.getMessage());
return NotificationResponseBo.to(response);
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
示例5: testGenerateNotificationResponseMessage
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
@Test
public void testGenerateNotificationResponseMessage() throws Exception {
NotificationResponseBo response = new NotificationResponseBo();
response.setStatus("PASS");
response.setMessage("Here is your response");
NotificationMessageContentService impl = services.getNotificationMessageContentService();
String xml = impl.generateNotificationResponseMessage(response);
assertTrue(xml.length() == 89);
}
示例6: testSendNotificationAsXml_producerNotAuthorized
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
@Test
public void testSendNotificationAsXml_producerNotAuthorized() throws IOException, XmlException {
NotificationService nSvc = services.getNotificationService();
final String notificationMessageAsXml = IOUtils.toString(getClass().getResourceAsStream("producer_not_authorized.xml"));
NotificationResponseBo response = nSvc.sendNotification(notificationMessageAsXml);
assertEquals(NotificationConstants.RESPONSE_STATUSES.FAILURE, response.getStatus());
assertEquals(NotificationConstants.RESPONSE_MESSAGES.PRODUCER_NOT_AUTHORIZED_FOR_CHANNEL, response.getMessage());
}
示例7: sendNotification
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
/**
* This method is responsible for parsing out the notification message which is sent in as a String
* of XML. It calls the appropriate services to validate the message content, converts it to a BO,
* and then passes it to another service where its content and meta-data is validated and if successful, it
* is saved.
* @see org.kuali.rice.ken.service.NotificationService#sendNotification(java.lang.String)
*/
public NotificationResponseBo sendNotification(String notificationMessageAsXml) throws IOException, XmlException {
// try to parse out the XML with the message content service
NotificationBo notification = messageContentService.parseNotificationRequestMessage(notificationMessageAsXml);
// now call out to the meat of the notification sending - this will validate users, groups, producers, and save
return sendNotification(notification);
}
示例8: generateNotificationResponseMessage
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
/**
* Generates a Notification response message
* @param response
* @return String XML representation of a Notification response object
*/
public String generateNotificationResponseMessage(NotificationResponseBo response);
示例9: sendNotification
import org.kuali.rice.ken.bo.NotificationResponseBo; //導入依賴的package包/類
/**
* This method allows consumers to send notification messages. This particular service
* accepts the XML format of the notification and then marshals it out into the actual
* business object construct, for further processing. The response is also sent back as
* a String of XML.
* @param notificationMessageAsXml
* @return NotificationResponse response object
*/
public NotificationResponseBo sendNotification(String notificationMessageAsXml) throws IOException, XmlException;