Package com.sun.identity.entitlement
Class RegExResourceName
- java.lang.Object
-
- com.sun.identity.entitlement.RegExResourceName
-
- All Implemented Interfaces:
ResourceName,BaseResourceName<ResourceMatch,EntitlementException>
public class RegExResourceName extends Object implements ResourceName
AResourceNameimplementation that matches the resourcenames using regular expressions.
-
-
Constructor Summary
Constructors Constructor Description RegExResourceName()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringappend(String superResource, String subResource)Appends sub-resource to super-resource.Stringcanonicalize(String res)Gets the canonicalized form of a resource string.ResourceMatchcompare(String origRes, String compRes, boolean wildcardCompare)Compares two resources.Set<String>getServiceTypeNames()Returns the service type names for which the resource name object can be used.StringgetSubResource(String resource, String superResource)Gets sub-resource from an original resource minus a super resource.voidinitialize(Map configParams)Initializes the resource name with configuration information, usually set by the administrators.String[]split(String res)Method to split a resource into the smallest necessary sub resource units.
-
-
-
Method Detail
-
getServiceTypeNames
public Set<String> getServiceTypeNames()
Description copied from interface:BaseResourceNameReturns the service type names for which the resource name object can be used.- Specified by:
getServiceTypeNamesin interfaceBaseResourceName<ResourceMatch,EntitlementException>- Returns:
- service type names for which the resource comparator can be used
-
initialize
public void initialize(Map configParams)
Description copied from interface:BaseResourceNameInitializes the resource name with configuration information, usually set by the administrators.- Specified by:
initializein interfaceBaseResourceName<ResourceMatch,EntitlementException>- Parameters:
configParams- configuration parameters as a map. The keys of the map are the configuration parameters. Each key is corresponding to oneStringvalue which specifies the configuration parameter value.
-
compare
public ResourceMatch compare(String origRes, String compRes, boolean wildcardCompare)
Description copied from interface:BaseResourceNameCompares two resources.- Specified by:
comparein interfaceBaseResourceName<ResourceMatch,EntitlementException>- Parameters:
origRes- name of the resource which will be comparedcompRes- name of the resource which will be compared withwildcardCompare- flag for wildcard comparison- Returns:
- returns
ResourceMatchthat specifies if the resources are exact match, or otherwise.ResourceMatch.NO_MATCHmeans two resources do not matchResourceMatch.EXACT_MATCHmeans two resources matchResourceMatch.SUB_RESOURCE_MATCHmeanscompResis the sub resource of theorigResResourceMatch.SUPER_RESOURCE_MATCHmeanscompResis the super resource of theorigResResourceMatch.WILDCARD_MATCHmeans two resources match with respect to the wildcard
-
append
public String append(String superResource, String subResource)
Description copied from interface:BaseResourceNameAppends sub-resource to super-resource.- Specified by:
appendin interfaceBaseResourceName<ResourceMatch,EntitlementException>- Parameters:
superResource- name of the super-resource to be appended to.subResource- name of the sub-resource to be appended.- Returns:
- returns the combination resource.
-
getSubResource
public String getSubResource(String resource, String superResource)
Description copied from interface:BaseResourceNameGets sub-resource from an original resource minus a super resource. This is the complementary method of append().- Specified by:
getSubResourcein interfaceBaseResourceName<ResourceMatch,EntitlementException>- Parameters:
resource- name of the original resource consisting of the second parametersuperResand the returned valuesuperResource- name of the super-resource which the first parameter begins with.- Returns:
- returns the sub-resource which the first parameter ends with. If the first parameter does not begin with the the first parameter, then the return value is null.
-
canonicalize
public String canonicalize(String res) throws EntitlementException
Description copied from interface:BaseResourceNameGets the canonicalized form of a resource string.- Specified by:
canonicalizein interfaceBaseResourceName<ResourceMatch,EntitlementException>- Parameters:
res- the resource string to be canonicalized- Returns:
- the resource string in its canonicalized form.
- Throws:
EntitlementException
-
split
public String[] split(String res)
Description copied from interface:BaseResourceNameMethod to split a resource into the smallest necessary sub resource units.- Specified by:
splitin interfaceBaseResourceName<ResourceMatch,EntitlementException>- Parameters:
res- name of the resource to be split- Returns:
- returns the array of sub-resources, with the first element being what the original resource begins with, and the last one being what it ends with
-
-