Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NotificationMessageContentService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007-2008 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.ken.service; | |
17 | ||
18 | import java.io.IOException; | |
19 | import java.io.InputStream; | |
20 | ||
21 | import javax.xml.parsers.ParserConfigurationException; | |
22 | ||
23 | import org.kuali.rice.ken.bo.Notification; | |
24 | import org.kuali.rice.ken.bo.NotificationResponse; | |
25 | import org.kuali.rice.ken.exception.InvalidXMLException; | |
26 | import org.xml.sax.SAXException; | |
27 | ||
28 | /** | |
29 | * Notification Message Content service - handles parsing the notification XML message and also marshalling out BOs for the response. | |
30 | * @see <a href="http://wiki.library.cornell.edu/wiki/display/notsys/Hi-Level+Service+Interface+Definitions#Hi-LevelServiceInterfaceDefinitions-NotificationMessageContentService">NotificationMessageContentService</a> | |
31 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
32 | */ | |
33 | public interface NotificationMessageContentService { | |
34 | /** | |
35 | * Parses a Notification request message into business objects. Performs syntactic and semantic validation. | |
36 | * This method takes an InputStream. | |
37 | * @param stream request message stream | |
38 | * @return Notification business object | |
39 | * @throws SAXException | |
40 | * @throws ParserConfigurationException | |
41 | * @throws IOException | |
42 | * @throws InvalidXMLException | |
43 | */ | |
44 | public Notification parseNotificationRequestMessage(InputStream stream) throws IOException, InvalidXMLException; | |
45 | ||
46 | /** | |
47 | * Parses a Notification request message into business objects. Performs syntactic and semantic validation. | |
48 | * This method takes a String of XML. | |
49 | * @param notificationMessageAsXml | |
50 | * @return | |
51 | * @throws IOException | |
52 | * @throws InvalidXMLException | |
53 | */ | |
54 | public Notification parseNotificationRequestMessage(String notificationMessageAsXml) throws IOException, InvalidXMLException; | |
55 | ||
56 | /** | |
57 | * Generates a Notification response message | |
58 | * @param response | |
59 | * @return String XML representation of a Notification response object | |
60 | */ | |
61 | public String generateNotificationResponseMessage(NotificationResponse response); | |
62 | ||
63 | /** | |
64 | * This method is responsible for marshalling out the passed in Notification object in and XML representation. | |
65 | * @param notification | |
66 | * @return String of XML. | |
67 | */ | |
68 | public String generateNotificationMessage(Notification notification); | |
69 | ||
70 | /** | |
71 | * This method is responsible for marshalling out the passed in Notification object in and XML representation, with | |
72 | * the addition of adding the specific recipient to the recipients list and removing the others. | |
73 | * @param notification | |
74 | * @param userRecipientId | |
75 | * @return String of XML. | |
76 | */ | |
77 | public String generateNotificationMessage(Notification notification, String userRecipientId); | |
78 | ||
79 | /** | |
80 | * This method parses out the serialized XML version of Notification BO and populates a Notification BO with it. | |
81 | * @param xmlAsBytes | |
82 | * @return Notification | |
83 | * @throws Exception | |
84 | */ | |
85 | public Notification parseSerializedNotificationXml(byte[] xmlAsBytes) throws Exception; | |
86 | } |