View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation 
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License. You may obtain a copy of the License at
7    *
8    * http://www.osedu.org/licenses/ECL-2.0
9    *
10   * Unless required by applicable law or agreed to in writing,
11   * software distributed under the License is distributed on an "AS IS"
12   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13   * or implied. See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  
17  package org.kuali.student.r2.common.messages.service;
18  
19  import java.util.List;
20  
21  import org.kuali.student.r2.common.dto.ContextInfo;
22  import org.kuali.student.r2.common.dto.LocaleInfo;
23  import org.kuali.student.r2.common.dto.StatusInfo;
24  
25  import org.kuali.student.r2.common.exceptions.DoesNotExistException;
26  import org.kuali.student.r2.common.exceptions.InvalidParameterException;
27  import org.kuali.student.r2.common.exceptions.MissingParameterException;
28  import org.kuali.student.r2.common.exceptions.OperationFailedException;
29  import org.kuali.student.r2.common.exceptions.PermissionDeniedException;
30  import org.kuali.student.r2.common.exceptions.ReadOnlyException;
31  import org.kuali.student.r2.common.exceptions.VersionMismatchException;
32  
33  import org.kuali.student.r2.common.messages.dto.MessageInfo;
34  import org.kuali.student.r2.common.util.constants.MessageServiceConstants;
35  
36  import javax.jws.WebParam;
37  import javax.jws.WebService;
38  import javax.jws.soap.SOAPBinding;
39  
40  /**
41   * The Message Service allows for the creation and management of
42   * messages.
43   *
44   * @Version 2.0
45   * @Author Sri komandur@uw.edu
46   */
47  
48  @WebService(name = "MessageService", targetNamespace = MessageServiceConstants.NAMESPACE)
49  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
50  public interface MessageService {
51  
52      /**
53       * Retrieves the list of locales supported by this service.
54       *
55       * @param contextInfo information containing the principalId and
56       *        locale information about the caller of service operation
57       * @return a list of locales supported by this service
58       * @throws InvalidParameterException contextInfo is not valid
59       * @throws MissingParameterException contextInfo is missing or null
60       * @throws OperationFailedException  unable to complete request
61       * @throws PermissionDeniedException an authorization failure occurred
62       */
63      public List<LocaleInfo> getLocales(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
64  
65      /**
66       * Retrieves the list of message group keys known by the service
67       *
68       * @param contextInfo information containing the principalId and
69       *        locale information about the caller of service operation
70       * @return a list of message group keys
71       * @throws InvalidParameterException contextInfo is not valid
72       * @throws MissingParameterException contextInfo is missing or null
73       * @throws OperationFailedException  unable to complete request
74       * @throws PermissionDeniedException an authorization failure occurred
75       */
76      public List<String> getMessageGroupKeys(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
77  
78      /**
79       * Retrieves message information.
80       *
81       * @param localeInfo the locale information
82       * @param messageGroupKey an identifier for the message group to
83       *        which the message belongs
84       * @param messageKey the identifier for the requested message
85       * @param contextInfo information containing the principalId and
86       *        locale information about the caller of service operation
87       * @return the requested message
88       * @throws DoesNotExistException messageGroupKey or messageKey is
89       *         not found
90       * @throws InvalidParameterException contextInfo is not valid
91       * @throws MissingParameterException localeInfo, messageGroupKey,
92       *         messageKey, or contextInfo is missing or null
93       * @throws OperationFailedException  unable to complete request
94       * @throws PermissionDeniedException an authorization failure occurred
95       */
96      public MessageInfo getMessage(@WebParam(name = "localeInfo") LocaleInfo localeInfo, @WebParam(name = "messageGroupKey") String messageGroupKey, @WebParam(name = "messageKey") String messageKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
97  
98      /**
99       * Retrieve messages associated with a locale and group.
100      *
101      * @param localeInfo the locale information
102      * @param messageGroupKey an identifier for the message group to
103      *        which the messages belong
104      * @param contextInfo information containing the principalId and
105      *        locale information about the caller of service operation
106      * @return a list of Messages
107      * @throws DoesNotExistException messageGroupKey is not found
108      * @throws InvalidParameterException loacleInfo or contextInfo is
109      *         not valid
110      * @throws MissingParameterException localeInfo, messageGroupKey,
111      *         or contextInfo is missing or null
112      * @throws OperationFailedException  unable to complete request
113      * @throws PermissionDeniedException an authorization failure occurred
114      */
115     public List<MessageInfo> getMessages(@WebParam(name = "localeInfo") LocaleInfo localeInfo, @WebParam(name = "messageGroupKey") String messageGroupKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
116 
117     /**
118      * Retrieve messages associated with a locale from a specified
119      * list of groups.
120      *
121      * @param localeInfo the locale information
122      * @param messageGroupKeys a list of identifiers for the message
123      *        groups
124      * @param contextInfo information containing the principalId and
125      *        locale information about the caller of service operation
126      * @return the list of Messages belonging to the list of message groups
127      * @throws DoesNotExistException localeInfo or a messageGroupKey
128      *         in messageGroupKeys is not found
129      * @throws InvalidParameterException localeInfo or contextInfo is
130      *          not valid
131      * @throws MissingParameterException localeInfo, messageGroupKeys,
132      *         a messageGroupKey in messagegroupKey, or contextInfo is
133      *         missing or null
134      * @throws OperationFailedException unable to complete request
135      * @throws PermissionDeniedException an authorization failure occurred
136      */
137     public List<MessageInfo> getMessagesByGroups(@WebParam(name = "localeInfo") LocaleInfo localeInfo, @WebParam(name = "messageGroupKeys") List<String> messageGroupKeys, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
138 
139     /**
140      * Update message associated with a locale and group.
141      *
142      * @param localeInfo the locale information
143      * @param messageKey the indentifier for the message
144      * @param messageInfo the message information to be updated
145      * @param contextInfo information containing the principalId and
146      *        locale information about the caller of service operation
147      * @return message information
148      * @throws DoesNotExistException messageKey is not found
149      * @throws InvalidParameterException localeInfo, messageInfo, or
150      *         contextInfo is not valid
151      * @throws MissingParameterException localeInfo, messageKey, messageInfo, 
152      *         or contextInfo is missing or null
153      * @throws OperationFailedException  unable to complete request
154      * @throws PermissionDeniedException an authorization failure occurred
155      * @throws ReadOnlyException an attempt at supplying information
156      *         designated as read only
157      * @throws VersionMismatchException an optimistic locking failure
158      *         or the action was attempted on an out of date version
159      */
160     public MessageInfo updateMessage(@WebParam(name = "localeInfo") LocaleInfo localeInfo, @WebParam(name = "messageKey") String messageKey, @WebParam(name = "messageInfo") MessageInfo messageInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException, VersionMismatchException;
161 
162     /**
163      * Deletes the message associated with a locale and group for a
164      * message key
165      *
166      * @param localeInfo the locale information
167      * @param messageKey an identifier for the Message to be deleted
168      * @param contextInfo information containing the principalId and
169      *        information about the caller of service operation
170      * @return the status of the operation. This must always be true.
171      * @throws DoesNotExistException messageKey not found for locale
172      * @throws InvalidParameterException localeInfo or contextInfo is 
173      *         not valid
174      * @throws MissingParameterException localeInfo, messageKey, or
175      *         contextInfo is missing or null
176      * @throws OperationFailedException  unable to complete request
177      * @throws PermissionDeniedException an authorization failure occurred
178      */
179     public StatusInfo deleteMessage(@WebParam(name = "localeInfo") LocaleInfo localeInfo, @WebParam(name = "messageKey") String messageKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
180 
181     /**
182      * Adds a message to the locale and group.
183      *
184      * @param localeInfo the locale information
185      * @param messageGroupKey an identifier for the message group
186      * @param messageInfo the message information to be added
187      * @param contextInfo information containing the principalId and
188      *        locale information about the caller of service operation
189      * @return the status of the operation. This must always be true.
190      * @throws DoesNotExistException messageGroupKey is not found
191      * @throws InvalidParameterException localeInfo or contetInfo is
192      *         not valid
193      * @throws MissingParameterException localeInfo, messageGroupKey,
194      *         or contextInfo is missing or null
195      * @throws OperationFailedException  unable to complete request
196      * @throws PermissionDeniedException an authorization failure occurred
197      */
198     public StatusInfo addMessage(@WebParam(name = "localeInfo") LocaleInfo localeInfo, @WebParam(name = "messageGroupKey") String messageGroupKey, @WebParam(name = "messageInfo") MessageInfo messageInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
199 }