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 | ||
16 | import org.kuali.student.common.dto.ContextInfo; | |
17 | import org.kuali.student.common.dto.StateInfo; | |
18 | import org.kuali.student.common.exceptions.DoesNotExistException; | |
19 | import org.kuali.student.common.exceptions.InvalidParameterException; | |
20 | import org.kuali.student.common.exceptions.MissingParameterException; | |
21 | import org.kuali.student.common.exceptions.OperationFailedException; | |
22 | ||
23 | /** | |
24 | * Provides a read-only view of states and state flow information. | |
25 | * | |
26 | * This service needs to be implemented by any KS service that is going to handle states | |
27 | * | |
28 | * Version: 1.0 (Dev) | |
29 | * | |
30 | * @author kamal | |
31 | */ | |
32 | @WebService(name = "StateService", targetNamespace = "http://student.kuali.org/wsdl/state") | |
33 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
34 | public interface StateService { | |
35 | ||
36 | ||
37 | /** | |
38 | * | |
39 | * This method retrieves the list of process keys associated with a type of object. | |
40 | * | |
41 | * @param typeKey Type key | |
42 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
43 | * @return List of process keys | |
44 | * @throws DoesNotExistException typeKey not found | |
45 | * @throws InvalidParameterException invalid typeKey | |
46 | * @throws MissingParameterException missing typeKey | |
47 | * @throws OperationFailedException unable to complete request | |
48 | */ | |
49 | public List<String> getProcessKeys(@WebParam(name = "typeKey") String typeKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
50 | ||
51 | /** | |
52 | * | |
53 | * 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. | |
54 | * | |
55 | * @param processKey Key identifying the process | |
56 | * @param stateKey Key of the state | |
57 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
58 | * @return Information about the state | |
59 | * @throws DoesNotExistException processKey, stateKey not found | |
60 | * @throws InvalidParameterException invalid processKey, stateKey | |
61 | * @throws MissingParameterException missing processKey, stateKey | |
62 | * @throws OperationFailedException unable to complete request | |
63 | */ | |
64 | public StateInfo getState(@WebParam(name = "processKey") String processKey, @WebParam(name = "stateKey") String stateKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
65 | ||
66 | /** | |
67 | * This method returns a list of States that belong to a process. For e.g Clu states for clu proposal process | |
68 | * | |
69 | * @param processKey Key identifying the process | |
70 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
71 | * @return List of StateInfo objects associated with the process | |
72 | * @throws DoesNotExistException processKey not found | |
73 | * @throws InvalidParameterException invalid processKey | |
74 | * @throws MissingParameterException missing processKey | |
75 | * @throws OperationFailedException unable to complete request | |
76 | */ | |
77 | public List<StateInfo> getStatesByProcess(@WebParam(name = "processKey") String processKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
78 | ||
79 | /** | |
80 | * This method returns a list of StateInfo objects that are valid initial states for a given process. | |
81 | * | |
82 | * Often there will be just a single initial valid state. | |
83 | * | |
84 | * ? if more than one does the order matter? i.e. the 1st one returned should be the default but others still allowed? | |
85 | * | |
86 | * @param processKey Process key | |
87 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
88 | * @return list of states are valid for the given process | |
89 | * @throws DoesNotExistException processKey not found | |
90 | * @throws InvalidParameterException invalid processKey | |
91 | * @throws MissingParameterException missing processKey | |
92 | * @throws OperationFailedException unable to complete request | |
93 | */ | |
94 | public List<StateInfo> getInitialValidStates(@WebParam(name = "processKey") String processKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
95 | ||
96 | ||
97 | /** | |
98 | * | |
99 | * This method retrieves the next happy state in a process given the current state. | |
100 | * | |
101 | * @param processKey Process key | |
102 | * @param currentStateKey Current state key | |
103 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
104 | * @return Next happy state in the process | |
105 | * @throws DoesNotExistException processKey or currentStateKey not found | |
106 | * @throws InvalidParameterException invalid processKey or currentStateKey | |
107 | * @throws MissingParameterException missing processKey or currentStateKey | |
108 | * @throws OperationFailedException unable to complete request | |
109 | */ | |
110 | public StateInfo getNextHappyState(@WebParam(name = "processKey") String processKey, @WebParam(name = "currentStateKey") String currentStateKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
111 | } |