Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
StateService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2011 The Kuali Foundation Licensed under the Educational Community License, Version 1.0 (the "License"); you may | |
3 | * not use this file except in compliance with the License. You may obtain a copy of the License at | |
4 | * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law or agreed to in writing, software | |
5 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | |
6 | * express or implied. See the License for the specific language governing permissions and limitations under the License. | |
7 | */ | |
8 | package org.kuali.student.common.service; | |
9 | ||
10 | import java.util.List; | |
11 | ||
12 | import javax.jws.WebParam; | |
13 | import javax.jws.WebService; | |
14 | import javax.jws.soap.SOAPBinding; | |
15 | import org.kuali.student.common.util.constants.StateServiceConstants; | |
16 | ||
17 | import org.kuali.student.r2.common.dto.ContextInfo; | |
18 | import org.kuali.student.r2.common.dto.StateInfo; | |
19 | import org.kuali.student.r2.common.exceptions.DoesNotExistException; | |
20 | import org.kuali.student.r2.common.exceptions.InvalidParameterException; | |
21 | import org.kuali.student.r2.common.exceptions.MissingParameterException; | |
22 | import org.kuali.student.r2.common.exceptions.OperationFailedException; | |
23 | ||
24 | /** | |
25 | * Provides a read-only view of states and state flow information. | |
26 | * | |
27 | * This service needs to be implemented by any KS service that is going to handle states | |
28 | * | |
29 | * Version: 1.0 (Dev) | |
30 | * | |
31 | * @author kamal | |
32 | */ | |
33 | @WebService(name = "StateService", targetNamespace = StateServiceConstants.NAMESPACE) | |
34 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
35 | public interface StateService { | |
36 | ||
37 | ||
38 | /** | |
39 | * | |
40 | * This method retrieves the list of process keys associated with a type of object. | |
41 | * | |
42 | * @param typeKey Type key | |
43 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
44 | * @return List of process keys | |
45 | * @throws DoesNotExistException typeKey not found | |
46 | * @throws InvalidParameterException invalid typeKey | |
47 | * @throws MissingParameterException missing typeKey | |
48 | * @throws OperationFailedException unable to complete request | |
49 | */ | |
50 | public List<String> getProcessKeys(@WebParam(name = "typeKey") String typeKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
51 | ||
52 | /** | |
53 | * | |
54 | * This method returns information about a state for a given process. State keys can be reused and state key along with process key uniquely identifies the state instance within a process. | |
55 | * | |
56 | * @param processKey Key identifying the process | |
57 | * @param stateKey Key of the state | |
58 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
59 | * @return Information about the state | |
60 | * @throws DoesNotExistException processKey, stateKey not found | |
61 | * @throws InvalidParameterException invalid processKey, stateKey | |
62 | * @throws MissingParameterException missing processKey, stateKey | |
63 | * @throws OperationFailedException unable to complete request | |
64 | */ | |
65 | public StateInfo getState(@WebParam(name = "processKey") String processKey, @WebParam(name = "stateKey") String stateKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
66 | ||
67 | /** | |
68 | * This method returns a list of States that belong to a process. For e.g Clu states for clu proposal process | |
69 | * | |
70 | * @param processKey Key identifying the process | |
71 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
72 | * @return List of StateInfo objects associated with the process | |
73 | * @throws DoesNotExistException processKey not found | |
74 | * @throws InvalidParameterException invalid processKey | |
75 | * @throws MissingParameterException missing processKey | |
76 | * @throws OperationFailedException unable to complete request | |
77 | */ | |
78 | public List<StateInfo> getStatesByProcess(@WebParam(name = "processKey") String processKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
79 | ||
80 | /** | |
81 | * This method returns a list of StateInfo objects that are valid initial states for a given process. | |
82 | * | |
83 | * Often there will be just a single initial valid state. | |
84 | * | |
85 | * ? if more than one does the order matter? i.e. the 1st one returned should be the default but others still allowed? | |
86 | * | |
87 | * @param processKey Process key | |
88 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
89 | * @return list of states are valid for the given process | |
90 | * @throws DoesNotExistException processKey not found | |
91 | * @throws InvalidParameterException invalid processKey | |
92 | * @throws MissingParameterException missing processKey | |
93 | * @throws OperationFailedException unable to complete request | |
94 | */ | |
95 | public List<StateInfo> getInitialValidStates(@WebParam(name = "processKey") String processKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
96 | ||
97 | ||
98 | /** | |
99 | * | |
100 | * This method retrieves the next happy state in a process given the current state. | |
101 | * | |
102 | * @param processKey Process key | |
103 | * @param currentStateKey Current state key | |
104 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
105 | * @return Next happy state in the process | |
106 | * @throws DoesNotExistException processKey or currentStateKey not found | |
107 | * @throws InvalidParameterException invalid processKey or currentStateKey | |
108 | * @throws MissingParameterException missing processKey or currentStateKey | |
109 | * @throws OperationFailedException unable to complete request | |
110 | */ | |
111 | public StateInfo getNextHappyState(@WebParam(name = "processKey") String processKey, @WebParam(name = "currentStateKey") String currentStateKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
112 | } |