| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| EnumerationManagementService |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2010 The Kuali Foundation Licensed under the | |
| 3 | * Educational Community License, Version 2.0 (the "License"); you may | |
| 4 | * not use this file except in compliance with the License. You may | |
| 5 | * obtain a copy of the License at | |
| 6 | * | |
| 7 | * http://www.osedu.org/licenses/ECL-2.0 | |
| 8 | * | |
| 9 | * Unless required by applicable law or agreed to in writing, | |
| 10 | * software distributed under the License is distributed on an "AS IS" | |
| 11 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | |
| 12 | * or implied. See the License for the specific language governing | |
| 13 | * permissions and limitations under the License. | |
| 14 | */ | |
| 15 | ||
| 16 | package org.kuali.student.r2.core.enumerationmanagement.service; | |
| 17 | ||
| 18 | import org.kuali.student.r2.common.dto.ContextInfo; | |
| 19 | import org.kuali.student.r2.common.dto.StatusInfo; | |
| 20 | import org.kuali.student.r2.common.dto.ValidationResultInfo; | |
| 21 | import org.kuali.student.r2.common.exceptions.AlreadyExistsException; | |
| 22 | import org.kuali.student.r2.common.exceptions.DataValidationErrorException; | |
| 23 | import org.kuali.student.r2.common.exceptions.DoesNotExistException; | |
| 24 | import org.kuali.student.r2.common.exceptions.InvalidParameterException; | |
| 25 | import org.kuali.student.r2.common.exceptions.MissingParameterException; | |
| 26 | import org.kuali.student.r2.common.exceptions.OperationFailedException; | |
| 27 | import org.kuali.student.r2.common.exceptions.PermissionDeniedException; | |
| 28 | import org.kuali.student.r2.common.exceptions.ReadOnlyException; | |
| 29 | import org.kuali.student.r2.common.exceptions.VersionMismatchException; | |
| 30 | import org.kuali.student.r2.common.util.constants.EnumerationManagementServiceConstants; | |
| 31 | import org.kuali.student.r2.core.enumerationmanagement.dto.EnumeratedValueInfo; | |
| 32 | import org.kuali.student.r2.core.enumerationmanagement.dto.EnumerationInfo; | |
| 33 | ||
| 34 | import javax.jws.WebParam; | |
| 35 | import javax.jws.WebService; | |
| 36 | import javax.jws.soap.SOAPBinding; | |
| 37 | import java.util.Date; | |
| 38 | import java.util.List; | |
| 39 | ||
| 40 | /** | |
| 41 | * Enumeration Management service supports the management of code tables for | |
| 42 | * other services. It is only accessed by authorized callers configuring some | |
| 43 | * piece of the system. | |
| 44 | * | |
| 45 | * @Version 2.0 | |
| 46 | * @Author Sri komandur@uw.edu | |
| 47 | */ | |
| 48 | ||
| 49 | @WebService(name = "EnumerationManagementService", targetNamespace = EnumerationManagementServiceConstants.NAMESPACE) | |
| 50 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
| 51 | public interface EnumerationManagementService { | |
| 52 | ||
| 53 | /** | |
| 54 | * Retrieves the list of meta information for the enumerations supported by | |
| 55 | * this service. | |
| 56 | * | |
| 57 | * @param contextInfo context information containing the principalId and | |
| 58 | * locale information about the caller of service | |
| 59 | * operation | |
| 60 | * @return List of enumeration meta information | |
| 61 | * @throws InvalidParameterException invalid contextInfo | |
| 62 | * @throws MissingParameterException missing contextInfo | |
| 63 | * @throws OperationFailedException unable to complete request | |
| 64 | * @throws PermissionDeniedException authorization failure | |
| 65 | */ | |
| 66 | public List<EnumerationInfo> getEnumerations(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
| 67 | ||
| 68 | /** | |
| 69 | * Retrieves meta information for a particular Enumeration. The meta | |
| 70 | * information should describe constraints on the various fields comprising | |
| 71 | * the enumeration as well as the allowed contexts. | |
| 72 | * | |
| 73 | * @param enumerationKey identifier for the Enumeration | |
| 74 | * @param contextInfo context information containing the principalId and | |
| 75 | * locale information about the caller of service | |
| 76 | * operation | |
| 77 | * @return Meta information about an enumeration | |
| 78 | * @throws DoesNotExistException enumerationKey not found | |
| 79 | * @throws InvalidParameterException invalid contextInfo | |
| 80 | * @throws MissingParameterException missing enumerationKey or contextInfo | |
| 81 | * @throws OperationFailedException unable to complete request | |
| 82 | * @throws PermissionDeniedException authorization failure | |
| 83 | */ | |
| 84 | public EnumerationInfo getEnumeration(@WebParam(name = "enumerationKey") String enumerationKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
| 85 | ||
| 86 | /** | |
| 87 | * Retrieves the list of values for a particular enumeration with a certain | |
| 88 | * context for a particular date. The values returned should be those where | |
| 89 | * the supplied date is between the effective and expiration dates. Certain | |
| 90 | * enumerations may not support this functionality. | |
| 91 | * | |
| 92 | * @param enumerationKey identifier for the Enumeration | |
| 93 | * @param contextTypeKey identifier for the enumeration context type | |
| 94 | * @param contextValue value for the enumeration context | |
| 95 | * @param contextDate date and time to get the enumeration for | |
| 96 | * @param contextInfo context information containing the principalId and | |
| 97 | * locale information about the caller of service | |
| 98 | * operation | |
| 99 | * @return List of Codes and Values | |
| 100 | * @throws DoesNotExistException enumerationKey not found | |
| 101 | * @throws InvalidParameterException invalid contextValue, contextDate or | |
| 102 | * contextInfo | |
| 103 | * @throws MissingParameterException missing enumerationKey, contextTypeKey, | |
| 104 | * contextValue, contextDate or | |
| 105 | * contextInfo | |
| 106 | * @throws OperationFailedException unable to complete request | |
| 107 | * @throws PermissionDeniedException authorization failure | |
| 108 | */ | |
| 109 | public List<EnumeratedValueInfo> getEnumeratedValues(@WebParam(name = "enumerationKey") String enumerationKey, @WebParam(name = "contextTypeKey") String contextTypeKey, @WebParam(name = "contextValue") String contextValue, @WebParam(name = "contextDate") Date contextDate, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
| 110 | ||
| 111 | ||
| 112 | /** | |
| 113 | * Validates an EnumerationValue. Depending on the value of validationType, | |
| 114 | * this validation could be limited to tests on just the current object and | |
| 115 | * its directly contained sub-objects or expanded to perform all tests | |
| 116 | * related to this object. If an identifier is present for the Process and a | |
| 117 | * record is found for that identifier, the validation checks if the Process | |
| 118 | * can be shifted to the new values. If a record cannot be found for the | |
| 119 | * identifier, it is assumed that the record does not exist and as such, the | |
| 120 | * checks performed will be much shallower, typically mimicking those | |
| 121 | * performed by setting the validationType to the current object. This is a | |
| 122 | * slightly different pattern from the standard validation as the caller | |
| 123 | * provides the identifier in the create statement instead of the server | |
| 124 | * assigning an identifier. | |
| 125 | * | |
| 126 | * @param validationTypeKey the identifier of the extent of validation | |
| 127 | * @param enumerationKey identifier for the Enumeration | |
| 128 | * @param code code identifying the value to be validated | |
| 129 | * @param enumeratedValueInfo the Room information to be tested | |
| 130 | * @param contextInfo Context information containing the principalId | |
| 131 | * and locale information about the caller of | |
| 132 | * service operation | |
| 133 | * @return Results from performing the validation | |
| 134 | * @throws DoesNotExistException validationTypeKey, enumerationKey or | |
| 135 | * code not found | |
| 136 | * @throws InvalidParameterException invalid enumeratedValueInfo or | |
| 137 | * contextInfo | |
| 138 | * @throws MissingParameterException missing validationTypeKey, enumerationKey, | |
| 139 | * code, enumeratedValueInfo or | |
| 140 | * contextInfo | |
| 141 | * @throws OperationFailedException unable to complete request | |
| 142 | * @throws PermissionDeniedException authorization failure | |
| 143 | */ | |
| 144 | public List<ValidationResultInfo> validateEnumeratedValue(@WebParam(name = "validationTypeKey") String validationTypeKey, @WebParam(name = "enumerationKey") String enumerationKey, @WebParam(name = "code") String code, @WebParam(name = "enumeratedValueInfo") EnumeratedValueInfo enumeratedValueInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
| 145 | ||
| 146 | ||
| 147 | /** | |
| 148 | * Updates a value in a particular Enumeration. The pattern in this | |
| 149 | * signature is different from most updates in that it is unlikely for | |
| 150 | * multiple individuals or processes to be altering the same construct at | |
| 151 | * the same time. | |
| 152 | * | |
| 153 | * @param enumerationKey identifier for the Enumeration | |
| 154 | * @param code code identifying the value to be updated | |
| 155 | * @param enumeratedValueInfo updated information on the value | |
| 156 | * @param contextInfo context information containing the principalId | |
| 157 | * and locale information about the caller of | |
| 158 | * service operation | |
| 159 | * @return updated enumerated value | |
| 160 | * @throws DataValidationErrorException supplied data is invalid | |
| 161 | * @throws DoesNotExistException enumerationKey, code not found | |
| 162 | * @throws InvalidParameterException invalid enumeratedValueInfo or | |
| 163 | * contextInfo | |
| 164 | * @throws MissingParameterException missing enumerationKey, code, | |
| 165 | * enumeratedValueInfo or contextInfo | |
| 166 | * @throws OperationFailedException unable to complete request | |
| 167 | * @throws PermissionDeniedException authorization failure | |
| 168 | * @throws ReadOnlyException an attempt at changing information | |
| 169 | * designated as read only | |
| 170 | * @throws VersionMismatchException an optimistic locking failure or the | |
| 171 | * action was attempted on an out of | |
| 172 | * date version | |
| 173 | */ | |
| 174 | public EnumeratedValueInfo updateEnumeratedValue(@WebParam(name = "enumerationKey") String enumerationKey, @WebParam(name = "code") String code, @WebParam(name = "enumeratedValueInfo") EnumeratedValueInfo enumeratedValueInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException, VersionMismatchException; | |
| 175 | ||
| 176 | /** | |
| 177 | * Removes a value from a particular Enumeration. This particular operation | |
| 178 | * should be used sparingly, as removal of a value may lead to dangling | |
| 179 | * references. It is suggested that standard procedure should be to update | |
| 180 | * the expiration date for the value so that it is seen as expired. | |
| 181 | * | |
| 182 | * @param enumerationKey Identifier for the Enumeration | |
| 183 | * @param code code identifying the value to be removed | |
| 184 | * @param contextInfo context information containing the principalId and | |
| 185 | * locale information about the caller of service | |
| 186 | * operation | |
| 187 | * @return Status of the operation (success, failed) | |
| 188 | * @throws DoesNotExistException enumerationKey, code not found | |
| 189 | * @throws InvalidParameterException invalid contextInfo | |
| 190 | * @throws MissingParameterException missing enumerationKey, code or | |
| 191 | * contextInfo | |
| 192 | * @throws OperationFailedException unable to complete request | |
| 193 | * @throws PermissionDeniedException authorization failure | |
| 194 | */ | |
| 195 | public StatusInfo deleteEnumeratedValue(@WebParam(name = "enumerationKey") String enumerationKey, @WebParam(name = "code") String code, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
| 196 | ||
| 197 | /** | |
| 198 | * Adds a value to a particular Enumeration. | |
| 199 | * | |
| 200 | * @param enumerationKey Identifier for the Enumeration | |
| 201 | * @param code code identifying the value to be added | |
| 202 | * @param enumeratedValueInfo Value to be added | |
| 203 | * @param contextInfo context information containing the principalId | |
| 204 | * and locale information about the caller of | |
| 205 | * service operation | |
| 206 | * @return Newly created enumerated value | |
| 207 | * @throws AlreadyExistsException combination of enumerationKey, code | |
| 208 | * already exists | |
| 209 | * @throws DataValidationErrorException supplied data is invalid | |
| 210 | * @throws DoesNotExistException enumerationKey not found | |
| 211 | * @throws InvalidParameterException invalid enumeratedValueInfo or | |
| 212 | * contextInfo | |
| 213 | * @throws MissingParameterException missing enumerationKey, enumeratedValueInfo | |
| 214 | * or contextInfo | |
| 215 | * @throws OperationFailedException unable to complete request | |
| 216 | * @throws PermissionDeniedException authorization failure | |
| 217 | * @throws ReadOnlyException an attempt at changing information | |
| 218 | * designated as read only | |
| 219 | */ | |
| 220 | public EnumeratedValueInfo addEnumeratedValue(@WebParam(name = "enumerationKey") String enumerationKey, @WebParam(name = "code") String code, @WebParam(name = "enumeratedValueInfo") EnumeratedValueInfo enumeratedValueInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws AlreadyExistsException, DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException; | |
| 221 | ||
| 222 | } | |
| 223 |