1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package org.kuali.student.r2.common.messages.service; |
16 | |
|
17 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
18 | |
import org.kuali.student.r2.common.dto.LocaleInfo; |
19 | |
import org.kuali.student.r2.common.dto.StatusInfo; |
20 | |
import org.kuali.student.r2.common.exceptions.DoesNotExistException; |
21 | |
import org.kuali.student.r2.common.exceptions.InvalidParameterException; |
22 | |
import org.kuali.student.r2.common.exceptions.MissingParameterException; |
23 | |
import org.kuali.student.r2.common.exceptions.OperationFailedException; |
24 | |
import org.kuali.student.r2.common.exceptions.PermissionDeniedException; |
25 | |
import org.kuali.student.r2.common.exceptions.ReadOnlyException; |
26 | |
import org.kuali.student.r2.common.exceptions.VersionMismatchException; |
27 | |
import org.kuali.student.r2.common.messages.dto.MessageInfo; |
28 | |
|
29 | |
import javax.jws.WebParam; |
30 | |
import java.util.List; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | 0 | public class MessageServiceDecorator implements MessageService { |
39 | |
|
40 | |
|
41 | |
private MessageService nextDecorator; |
42 | |
|
43 | |
public MessageService getNextDecorator() throws OperationFailedException { |
44 | 0 | if (null == nextDecorator) { |
45 | 0 | throw new OperationFailedException("Misconfigured application: nextDecorator is null"); |
46 | |
} |
47 | 0 | return nextDecorator; |
48 | |
} |
49 | |
|
50 | |
public void setNextDecorator(MessageService nextDecorator) { |
51 | 0 | this.nextDecorator = nextDecorator; |
52 | 0 | } |
53 | |
@Override |
54 | |
public List<LocaleInfo> getLocales(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
55 | 0 | return getNextDecorator().getLocales(contextInfo); |
56 | |
} |
57 | |
|
58 | |
@Override |
59 | |
public List<String> getMessageGroupKeys(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
60 | 0 | return getNextDecorator().getMessageGroupKeys(contextInfo); |
61 | |
} |
62 | |
|
63 | |
@Override |
64 | |
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 { |
65 | 0 | return getNextDecorator().getMessage(localeInfo, messageGroupKey, messageKey, contextInfo); |
66 | |
} |
67 | |
|
68 | |
@Override |
69 | |
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 { |
70 | 0 | return getNextDecorator().getMessages(localeInfo, messageGroupKey, contextInfo); |
71 | |
} |
72 | |
|
73 | |
@Override |
74 | |
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 { |
75 | 0 | return getNextDecorator().getMessagesByGroups(localeInfo, messageGroupKeys, contextInfo); |
76 | |
} |
77 | |
|
78 | |
@Override |
79 | |
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 { |
80 | 0 | return getNextDecorator().updateMessage(localeInfo, messageKey, messageInfo, contextInfo); |
81 | |
} |
82 | |
|
83 | |
@Override |
84 | |
public StatusInfo deleteMessage(@WebParam(name = "localeInfo") LocaleInfo localeInfo, @WebParam(name = "messageKey") String messageKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
85 | 0 | return getNextDecorator().deleteMessage(localeInfo, messageKey, contextInfo); |
86 | |
} |
87 | |
|
88 | |
@Override |
89 | |
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 { |
90 | 0 | return getNextDecorator().addMessage(localeInfo, messageGroupKey, messageInfo, contextInfo); |
91 | |
} |
92 | |
} |