1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.enrollment.lpr.service.adapter.validation; |
17 | |
|
18 | |
import org.kuali.student.common.exceptions.InvalidParameterException; |
19 | |
import org.kuali.student.common.exceptions.VersionMismatchException; |
20 | |
import org.kuali.student.common.exceptions.MissingParameterException; |
21 | |
import org.kuali.student.common.exceptions.OperationFailedException; |
22 | |
import org.kuali.student.common.exceptions.DataValidationErrorException; |
23 | |
import org.kuali.student.common.exceptions.PermissionDeniedException; |
24 | |
import org.kuali.student.common.exceptions.DisabledIdentifierException; |
25 | |
import org.kuali.student.common.exceptions.AlreadyExistsException; |
26 | |
import org.kuali.student.common.exceptions.DoesNotExistException; |
27 | |
import org.kuali.student.common.exceptions.ReadOnlyException; |
28 | |
|
29 | |
import java.util.List; |
30 | |
import org.kuali.student.common.dto.ContextInfo; |
31 | |
import org.kuali.student.common.dto.StatusInfo; |
32 | |
import org.kuali.student.enrollment.lpr.dto.LuiPersonRelationInfo; |
33 | |
import org.kuali.student.enrollment.lpr.mock.LuiPersonRelationServiceAdapter; |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | 0 | public class LuiPersonRelationMissingParameterCheckerAdapter |
42 | |
extends LuiPersonRelationServiceAdapter { |
43 | |
|
44 | |
@Override |
45 | |
public String createLuiPersonRelation(String personId, String luiId, |
46 | |
String luiPersonRelationType, |
47 | |
LuiPersonRelationInfo luiPersonRelationInfo, |
48 | |
ContextInfo context) |
49 | |
throws DataValidationErrorException, |
50 | |
AlreadyExistsException, |
51 | |
DoesNotExistException, |
52 | |
ReadOnlyException, |
53 | |
DisabledIdentifierException, |
54 | |
InvalidParameterException, |
55 | |
MissingParameterException, OperationFailedException, |
56 | |
PermissionDeniedException { |
57 | 0 | checkParameter("personId", personId); |
58 | 0 | checkParameter("luiId", luiId); |
59 | 0 | checkParameter("luiPersonRelationType", luiPersonRelationType); |
60 | 0 | checkParameter("luiPersonRelationInfo", luiPersonRelationInfo); |
61 | 0 | checkParameter("context", context); |
62 | 0 | return (getLprService().createLuiPersonRelation(personId, luiId, |
63 | |
luiPersonRelationType, |
64 | |
luiPersonRelationInfo, |
65 | |
context)); |
66 | |
} |
67 | |
|
68 | |
@Override |
69 | |
public List<String> createBulkRelationshipsForPerson(String personId, |
70 | |
List<String> luiIdList, |
71 | |
String relationState, |
72 | |
String luiPersonRelationType, |
73 | |
LuiPersonRelationInfo luiPersonRelationInfo, |
74 | |
ContextInfo context) |
75 | |
throws DataValidationErrorException, |
76 | |
AlreadyExistsException, DoesNotExistException, |
77 | |
DisabledIdentifierException, ReadOnlyException, InvalidParameterException, |
78 | |
MissingParameterException, OperationFailedException, |
79 | |
PermissionDeniedException { |
80 | |
|
81 | 0 | checkParameter("personId", personId); |
82 | 0 | checkParameter("luiIdList", luiIdList); |
83 | 0 | checkParameter("relationState", relationState); |
84 | 0 | checkParameter("luiPersonRelationType", luiPersonRelationType); |
85 | 0 | checkParameter("luiPersonRelationInfo", luiPersonRelationInfo); |
86 | 0 | checkParameter("context", context); |
87 | 0 | return (getLprService().createBulkRelationshipsForPerson(personId, luiIdList, |
88 | |
relationState, |
89 | |
luiPersonRelationType, |
90 | |
luiPersonRelationInfo, |
91 | |
context)); |
92 | |
} |
93 | |
|
94 | |
@Override |
95 | |
public LuiPersonRelationInfo updateLuiPersonRelation( |
96 | |
String luiPersonRelationId, LuiPersonRelationInfo luiPersonRelationInfo, |
97 | |
ContextInfo context) |
98 | |
throws DataValidationErrorException, |
99 | |
DoesNotExistException, InvalidParameterException, |
100 | |
MissingParameterException, ReadOnlyException, OperationFailedException, |
101 | |
PermissionDeniedException, VersionMismatchException { |
102 | 0 | checkParameter("luiPersonRelationId", luiPersonRelationId); |
103 | 0 | checkParameter("luiPersonRelationInfo", luiPersonRelationInfo); |
104 | 0 | checkParameter("context", context); |
105 | 0 | return (getLprService().updateLuiPersonRelation(luiPersonRelationId, |
106 | |
luiPersonRelationInfo, |
107 | |
context)); |
108 | |
} |
109 | |
|
110 | |
@Override |
111 | |
public StatusInfo deleteLuiPersonRelation(String luiPersonRelationId, |
112 | |
ContextInfo context) throws |
113 | |
DoesNotExistException, InvalidParameterException, MissingParameterException, |
114 | |
OperationFailedException, |
115 | |
PermissionDeniedException { |
116 | 0 | checkParameter("luiPersonRelationId", luiPersonRelationId); |
117 | 0 | checkParameter("context", context); |
118 | 0 | return (getLprService().deleteLuiPersonRelation(luiPersonRelationId, context)); |
119 | |
} |
120 | |
|
121 | |
protected void checkParameter(String parameterName, Object parameter) |
122 | |
throws MissingParameterException { |
123 | |
|
124 | 0 | if (parameter == null) { |
125 | 0 | throw new MissingParameterException(parameterName); |
126 | |
} |
127 | 0 | } |
128 | |
} |