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.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.TypeServiceConstants; | |
16 | ||
17 | import org.kuali.student.r2.common.dto.ContextInfo; | |
18 | import org.kuali.student.r2.common.dto.TypeInfo; | |
19 | import org.kuali.student.r2.common.dto.TypeTypeRelationInfo; | |
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 | ||
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 | public interface TypeService { | |
38 | ||
39 | /** | |
40 | * This method returns the TypeInfo associated for a given type key | |
41 | * | |
42 | * @param typeKey Key of the type | |
43 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
44 | * @return Information about the Type | |
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 TypeInfo getType(@WebParam(name = "typeKey") String typeKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
51 | ||
52 | /** | |
53 | * This method returns a list of TypeInfo that belong to a RefObjectURI. For e.g all types for CluInfo | |
54 | * | |
55 | * @param refObjectURI URI identifying the object e.g http://student.kuali.org/LuService/CluInfo | |
56 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
57 | * @return List of TypeInfo objects associated with the object | |
58 | * @throws DoesNotExistException refObjectURI not found | |
59 | * @throws InvalidParameterException invalid refObjectURI | |
60 | * @throws MissingParameterException missing refObjectURI | |
61 | * @throws OperationFailedException unable to complete request | |
62 | */ | |
63 | public List<TypeInfo> getTypesByRefObjectURI(@WebParam(name = "refObjectURI") String refObjectURI, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
64 | ||
65 | /** | |
66 | * This method returns a list of TypeInfo objects that are allowed for another typeKey. This is a convenience method to | |
67 | * retrieve TypeTypeRelation with allowed relation type. This will retrieve all the type keys associated with the | |
68 | * ObjectURI of the related type. The relationship is captured unidirectionally from ownerType to relatedType. | |
69 | * | |
70 | * @param ownerTypeKey Type key of the owner in the relation | |
71 | * @param relatedRefObjectURI RefObjectURI of the related type. | |
72 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
73 | * @return list of types | |
74 | * @throws DoesNotExistException ownerTypeKey or relatedRefObjectURI not found | |
75 | * @throws InvalidParameterException invalid ownerTypeKey or relatedRefObjectURI | |
76 | * @throws MissingParameterException missing ownerTypeKey or relatedRefObjectURI | |
77 | * @throws OperationFailedException unable to complete request | |
78 | */ | |
79 | public List<TypeInfo> getAllowedTypesForType(@WebParam(name = "ownerTypeKey") String ownerTypeKey, @WebParam(name = "relatedRefObjectURI") String relatedRefObjectURI, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
80 | ||
81 | ||
82 | /** | |
83 | * | |
84 | * This method retrieves all the TypeTypeRelation objects for a given ownerType and the relationType | |
85 | * | |
86 | * @param ownerTypeKey Type key of the owner in the relation | |
87 | * @param relationTypeKey Type key of the relation | |
88 | * @param context Context information containing the principalId and locale information about the caller of service operation | |
89 | * @return List of TypeTypeRelations for a given ownerType | |
90 | * @throws DoesNotExistException ownerTypeKey or relationTypeKey not found | |
91 | * @throws InvalidParameterException invalid ownerTypeKey or relationTypeKey | |
92 | * @throws MissingParameterException missing ownerTypeKey or relationTypeKey | |
93 | * @throws OperationFailedException unable to complete request | |
94 | */ | |
95 | public List<TypeTypeRelationInfo> getTypeRelationsByOwnerType(@WebParam(name = "ownerTypeKey") String ownerTypeKey, @WebParam(name = "relationTypeKey") String relationTypeKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
96 | } |