當前位置: 首頁>>代碼示例>>Java>>正文


Java NotificationResponseBo類代碼示例

本文整理匯總了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);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:16,代碼來源:NotificationServiceImpl.java

示例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;
   }
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:14,代碼來源:NotificationMessageContentServiceImpl.java

示例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);
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:20,代碼來源:SendNotificationServiceKewXmlImpl.java

示例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);
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:16,代碼來源:SendNotificationServiceKewXmlImpl.java

示例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);
   }
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:10,代碼來源:NotificationMessageContentServiceImplTest.java

示例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());
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:11,代碼來源:NotificationServiceImplTest.java

示例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);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:15,代碼來源:NotificationServiceImpl.java

示例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);
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:7,代碼來源:NotificationMessageContentService.java

示例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;
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:10,代碼來源:NotificationService.java


注:本文中的org.kuali.rice.ken.bo.NotificationResponseBo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。