Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TypeService |
|
| 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.r2.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.r2.common.dto.ContextInfo; | |
17 | import org.kuali.student.r2.common.dto.TypeInfo; | |
18 | import org.kuali.student.r2.common.dto.TypeTypeRelationInfo; | |
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 | import org.kuali.student.r2.common.util.constants.TypeServiceConstants; | |
24 | ||
25 | /** | |
26 | * Provides a read-only view of types and type type relations. | |
27 | * | |
28 | * This service needs to be implemented by any KS service that is | |
29 | * going to handle types | |
30 | * | |
31 | * Version: 1.0 (Dev) | |
32 | * | |
33 | * @author kamal | |
34 | */ | |
35 | @WebService(name = "TypeService", targetNamespace = TypeServiceConstants.NAMESPACE) | |
36 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
37 | ||
38 | public interface TypeService { | |
39 | ||
40 | /** | |
41 | * This method returns the TypeInfo associated for a given type key | |
42 | * | |
43 | * @param typeKey Key of the type | |
44 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
45 | * @return Information about the Type | |
46 | * @throws DoesNotExistException typeKey not found | |
47 | * @throws InvalidParameterException invalid typeKey | |
48 | * @throws MissingParameterException missing typeKey | |
49 | * @throws OperationFailedException unable to complete request | |
50 | */ | |
51 | public TypeInfo getType(@WebParam(name = "typeKey") String typeKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
52 | ||
53 | /** | |
54 | * This method returns a list of TypeInfo that belong to a | |
55 | * RefObjectURI. For e.g all types for CluInfo | |
56 | * | |
57 | * @param refObjectURI URI identifying the object e.g http://student.kuali.org/wsdl/luService/CluInfo | |
58 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
59 | * @return List of TypeInfo objects associated with the object | |
60 | * @throws DoesNotExistException refObjectURI not found | |
61 | * @throws InvalidParameterException invalid refObjectURI | |
62 | * @throws MissingParameterException missing refObjectURI | |
63 | * @throws OperationFailedException unable to complete request | |
64 | */ | |
65 | public List<TypeInfo> getTypesByRefObjectURI(@WebParam(name = "refObjectURI") String refObjectURI, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
66 | ||
67 | /** | |
68 | * This method returns a list of TypeInfo objects that are allowed | |
69 | * for another typeKey. This is a convenience method to retrieve | |
70 | * TypeTypeRelation with allowed relation type. This will retrieve | |
71 | * all the type keys associated with the ObjectURI of the related | |
72 | * type. The relationship is captured unidirectionally from | |
73 | * ownerType to relatedType. | |
74 | * | |
75 | * @param ownerTypeKey Type key of the owner in the relation | |
76 | * @param relatedRefObjectURI RefObjectURI of the related type. | |
77 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
78 | * @return list of types | |
79 | * @throws DoesNotExistException ownerTypeKey or relatedRefObjectURI not found | |
80 | * @throws InvalidParameterException invalid ownerTypeKey or relatedRefObjectURI | |
81 | * @throws MissingParameterException missing ownerTypeKey or relatedRefObjectURI | |
82 | * @throws OperationFailedException unable to complete request | |
83 | */ | |
84 | public List<TypeInfo> getAllowedTypesForType(@WebParam(name = "ownerTypeKey") String ownerTypeKey, @WebParam(name = "relatedRefObjectURI") String relatedRefObjectURI, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
85 | ||
86 | /** | |
87 | * This method retrieves all the TypeTypeRelation objects for a | |
88 | * given ownerType and the relationType | |
89 | * | |
90 | * @param ownerTypeKey Type key of the owner in the relation | |
91 | * @param relationTypeKey Type key of the relation | |
92 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
93 | * @return List of TypeTypeRelations for a given ownerType | |
94 | * @throws DoesNotExistException ownerTypeKey or relationTypeKey not found | |
95 | * @throws InvalidParameterException invalid ownerTypeKey or relationTypeKey | |
96 | * @throws MissingParameterException missing ownerTypeKey or relationTypeKey | |
97 | * @throws OperationFailedException unable to complete request | |
98 | */ | |
99 | public List<TypeTypeRelationInfo> getTypeRelationsByOwnerType(@WebParam(name = "ownerTypeKey") String ownerTypeKey, @WebParam(name = "relationTypeKey") String relationTypeKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
100 | } |