1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.kim.responsibility; |
17 | |
|
18 | |
import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; |
19 | |
import org.kuali.rice.kim.api.responsibility.Responsibility; |
20 | |
import org.kuali.rice.kim.framework.responsibility.ResponsibilityTypeService; |
21 | |
import org.kuali.rice.kns.kim.type.DataDictionaryTypeServiceBase; |
22 | |
|
23 | |
import java.util.ArrayList; |
24 | |
import java.util.Collections; |
25 | |
import java.util.List; |
26 | |
import java.util.Map; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
@Deprecated |
32 | 0 | public class KimResponsibilityTypeServiceBase extends DataDictionaryTypeServiceBase |
33 | |
implements ResponsibilityTypeService { |
34 | |
|
35 | |
@Override |
36 | |
public final List<Responsibility> getMatchingResponsibilities( Map<String, String> requestedDetails, List<Responsibility> responsibilitiesList ) { |
37 | 0 | if (requestedDetails == null) { |
38 | 0 | throw new RiceIllegalArgumentException("requestedDetails is null"); |
39 | |
} |
40 | |
|
41 | 0 | if (responsibilitiesList == null) { |
42 | 0 | throw new RiceIllegalArgumentException("responsibilitiesList is null"); |
43 | |
} |
44 | |
|
45 | 0 | requestedDetails = translateInputAttributes(requestedDetails); |
46 | 0 | validateRequiredAttributesAgainstReceived(requestedDetails); |
47 | 0 | return Collections.unmodifiableList(performResponsibilityMatches(requestedDetails, responsibilitiesList)); |
48 | |
} |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
protected List<Responsibility> performResponsibilityMatches(Map<String, String> requestedDetails, List<Responsibility> responsibilitiesList) { |
57 | 0 | List<Responsibility> matchingResponsibilities = new ArrayList<Responsibility>(); |
58 | 0 | for (Responsibility responsibility : responsibilitiesList) { |
59 | 0 | if ( performMatch(requestedDetails, responsibility.getAttributes())) { |
60 | 0 | matchingResponsibilities.add( responsibility ); |
61 | |
} |
62 | |
} |
63 | 0 | return matchingResponsibilities; |
64 | |
} |
65 | |
} |