| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kim.api.role; |
| 17 | |
|
| 18 | |
import org.apache.commons.lang.StringUtils; |
| 19 | |
import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; |
| 20 | |
import org.kuali.rice.core.api.uif.RemotableAttributeError; |
| 21 | |
import org.kuali.rice.kim.api.type.KimAttributeField; |
| 22 | |
import org.kuali.rice.kim.framework.role.RoleTypeService; |
| 23 | |
|
| 24 | |
import java.util.ArrayList; |
| 25 | |
import java.util.Collections; |
| 26 | |
import java.util.List; |
| 27 | |
import java.util.Map; |
| 28 | |
|
| 29 | 0 | public abstract class PassThruRoleTypeServiceBase implements RoleTypeService { |
| 30 | |
|
| 31 | 0 | private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PassThruRoleTypeServiceBase.class); |
| 32 | |
|
| 33 | |
public static final String UNMATCHABLE_QUALIFICATION = "!~!~!~!~!~"; |
| 34 | |
|
| 35 | |
@Override |
| 36 | |
public abstract Map<String, String> convertQualificationForMemberRoles(String namespaceCode, String roleName, String memberRoleNamespaceCode, String memberRoleName, Map<String, String> qualification); |
| 37 | |
|
| 38 | |
@Override |
| 39 | |
public List<RoleMembership> getMatchingRoleMemberships(Map<String, String> qualification, |
| 40 | |
List<RoleMembership> roleMemberList) { |
| 41 | |
|
| 42 | 0 | if (qualification == null) { |
| 43 | 0 | throw new RiceIllegalArgumentException("qualification was null"); |
| 44 | |
} |
| 45 | |
|
| 46 | 0 | if (roleMemberList == null) { |
| 47 | 0 | throw new RiceIllegalArgumentException("roleMemberList was null"); |
| 48 | |
} |
| 49 | 0 | return Collections.unmodifiableList(new ArrayList<RoleMembership>(roleMemberList)); |
| 50 | |
} |
| 51 | |
|
| 52 | |
@Override |
| 53 | |
public boolean doesRoleQualifierMatchQualification(Map<String, String> qualification, Map<String, String> roleQualifier) { |
| 54 | 0 | if (qualification == null) { |
| 55 | 0 | throw new RiceIllegalArgumentException("qualification was null"); |
| 56 | |
} |
| 57 | |
|
| 58 | 0 | if (roleQualifier == null) { |
| 59 | 0 | throw new RiceIllegalArgumentException("roleQualifier was null"); |
| 60 | |
} |
| 61 | |
|
| 62 | 0 | return true; |
| 63 | |
} |
| 64 | |
|
| 65 | |
@Override |
| 66 | |
public boolean hasApplicationRole(String principalId, List<String> groupIds, String namespaceCode, String roleName, Map<String, String> qualification) { |
| 67 | 0 | if (StringUtils.isBlank(principalId)) { |
| 68 | 0 | throw new RiceIllegalArgumentException("principalId was null or blank"); |
| 69 | |
} |
| 70 | |
|
| 71 | 0 | if (groupIds == null) { |
| 72 | 0 | throw new RiceIllegalArgumentException("groupIds was null or blank"); |
| 73 | |
} |
| 74 | |
|
| 75 | 0 | if (StringUtils.isBlank(namespaceCode)) { |
| 76 | 0 | throw new RiceIllegalArgumentException("namespaceCode was null or blank"); |
| 77 | |
} |
| 78 | |
|
| 79 | 0 | if (StringUtils.isBlank(roleName)) { |
| 80 | 0 | throw new RiceIllegalArgumentException("roleName was null or blank"); |
| 81 | |
} |
| 82 | |
|
| 83 | 0 | if (qualification == null) { |
| 84 | 0 | throw new RiceIllegalArgumentException("qualification was null"); |
| 85 | |
} |
| 86 | |
|
| 87 | 0 | return false; |
| 88 | |
} |
| 89 | |
|
| 90 | |
@Override |
| 91 | |
public boolean isApplicationRoleType() { |
| 92 | 0 | return false; |
| 93 | |
} |
| 94 | |
|
| 95 | |
public List<String> getAcceptedAttributeNames() { |
| 96 | 0 | return Collections.emptyList(); |
| 97 | |
} |
| 98 | |
|
| 99 | |
@Override |
| 100 | |
public List<KimAttributeField> getAttributeDefinitions(String kimTypeId) { |
| 101 | 0 | if (StringUtils.isBlank(kimTypeId)) { |
| 102 | 0 | throw new RiceIllegalArgumentException("kimTypeId was null or blank"); |
| 103 | |
} |
| 104 | |
|
| 105 | 0 | return Collections.emptyList(); |
| 106 | |
} |
| 107 | |
|
| 108 | |
@Override |
| 109 | |
public String getWorkflowDocumentTypeName() { |
| 110 | 0 | return null; |
| 111 | |
} |
| 112 | |
|
| 113 | |
@Override |
| 114 | |
public List<String> getWorkflowRoutingAttributes(String routeLevel) { |
| 115 | 0 | if (StringUtils.isBlank(routeLevel)) { |
| 116 | 0 | throw new RiceIllegalArgumentException("routeLevel was null or blank"); |
| 117 | |
} |
| 118 | |
|
| 119 | 0 | return Collections.emptyList(); |
| 120 | |
} |
| 121 | |
|
| 122 | |
public boolean supportsAttributes(List<String> attributeNames) { |
| 123 | 0 | if (attributeNames == null) { |
| 124 | 0 | throw new RiceIllegalArgumentException("attributeNames was null"); |
| 125 | |
} |
| 126 | |
|
| 127 | 0 | return true; |
| 128 | |
} |
| 129 | |
|
| 130 | |
public Map<String, String> translateInputAttributes(Map<String, String> inputAttributes) { |
| 131 | 0 | if (inputAttributes == null) { |
| 132 | 0 | throw new RiceIllegalArgumentException("inputAttributes was null"); |
| 133 | |
} |
| 134 | |
|
| 135 | 0 | return inputAttributes; |
| 136 | |
} |
| 137 | |
|
| 138 | |
@Override |
| 139 | |
public List<RemotableAttributeError> validateAttributes(String kimTypeId, Map<String, String> attributes) { |
| 140 | 0 | if (StringUtils.isBlank(kimTypeId)) { |
| 141 | 0 | throw new RiceIllegalArgumentException("kimTypeId was null or blank"); |
| 142 | |
} |
| 143 | |
|
| 144 | 0 | if (attributes == null) { |
| 145 | 0 | throw new RiceIllegalArgumentException("attributes was null or blank"); |
| 146 | |
} |
| 147 | |
|
| 148 | 0 | return Collections.emptyList(); |
| 149 | |
} |
| 150 | |
|
| 151 | |
@Override |
| 152 | |
public List<RemotableAttributeError> validateAttributesAgainstExisting(String kimTypeId, Map<String, String> newAttributes, Map<String, String> oldAttributes){ |
| 153 | 0 | if (StringUtils.isBlank(kimTypeId)) { |
| 154 | 0 | throw new RiceIllegalArgumentException("kimTypeId was null or blank"); |
| 155 | |
} |
| 156 | |
|
| 157 | 0 | if (newAttributes == null) { |
| 158 | 0 | throw new RiceIllegalArgumentException("newAttributes was null or blank"); |
| 159 | |
} |
| 160 | |
|
| 161 | 0 | if (oldAttributes == null) { |
| 162 | 0 | throw new RiceIllegalArgumentException("oldAttributes was null or blank"); |
| 163 | |
} |
| 164 | |
|
| 165 | 0 | return Collections.emptyList(); |
| 166 | |
} |
| 167 | |
|
| 168 | |
@Override |
| 169 | |
public boolean dynamicRoleMembership(String namespaceCode, String roleName) { |
| 170 | 0 | if (StringUtils.isBlank(namespaceCode)) { |
| 171 | 0 | throw new RiceIllegalArgumentException("namespaceCode was null or blank"); |
| 172 | |
} |
| 173 | |
|
| 174 | 0 | if (StringUtils.isBlank(roleName)) { |
| 175 | 0 | throw new RiceIllegalArgumentException("roleName was null or blank"); |
| 176 | |
} |
| 177 | |
|
| 178 | 0 | return false; |
| 179 | |
} |
| 180 | |
|
| 181 | |
} |