public class ExactMatchResourceName extends Object implements Comparator, ResourceName
PrefixResourceName
to provide special handling to
URL type prefix resource names in canonicalize
method
like validating port, assigning default port of 80, if port absent etc.Constructor and Description |
---|
ExactMatchResourceName() |
Modifier and Type | Method and Description |
---|---|
String |
append(String superResource,
String subResource)
Appends sub-resource to super-resource.
|
String |
canonicalize(String str)
Canonicalizes a string.
|
int |
compare(Object o1,
Object o2)
This method is used to compare two url query parameter
strings.
|
ResourceMatch |
compare(String requestResource,
String targetResource,
boolean wildcardCompare)
Compares two resources.
|
Set<String> |
getServiceTypeNames()
Returns the service type names for which the resource name
object can be used.
|
String |
getSubResource(String resource,
String superResource)
Gets sub-resource from an original resource minus
a super resource.
|
void |
initialize(Map configParams)
Initializes the resource name with configuration information,
usually set by the administrators.
|
boolean |
matches(String s,
String p) |
String[] |
split(String res)
Method to split a resource into the smallest necessary
sub resource units.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public void initialize(Map configParams)
BaseResourceName
initialize
in interface BaseResourceName<ResourceMatch,EntitlementException>
configParams
- configuration parameters as a map.
The keys of the map are the configuration parameters.
Each key is corresponding to one String
value
which specifies the configuration parameter value.public String canonicalize(String str) throws EntitlementException
canonicalize
in interface BaseResourceName<ResourceMatch,EntitlementException>
str
- the url string to be canonicalizedEntitlementException
- if the url string is invalidpublic int compare(Object o1, Object o2)
compare
in interface Comparator
o1
- a url query parameter to be comparedo2
- a url query parameter to be comparedpublic String getSubResource(String resource, String superResource)
BaseResourceName
getSubResource
in interface BaseResourceName<ResourceMatch,EntitlementException>
resource
- name of the original resource consisting of
the second parameter superRes
and the returned valuesuperResource
- name of the super-resource which the first
parameter begins with.public String append(String superResource, String subResource)
BaseResourceName
append
in interface BaseResourceName<ResourceMatch,EntitlementException>
superResource
- name of the super-resource to be appended to.subResource
- name of the sub-resource to be appended.public ResourceMatch compare(String requestResource, String targetResource, boolean wildcardCompare)
BaseResourceName
compare
in interface BaseResourceName<ResourceMatch,EntitlementException>
requestResource
- name of the resource which will be comparedtargetResource
- name of the resource which will be compared withwildcardCompare
- flag for wildcard comparisonResourceMatch
that
specifies if the resources are exact match, or
otherwise.
ResourceMatch.NO_MATCH
means two resources do not match
ResourceMatch.EXACT_MATCH
means two resources match
ResourceMatch.SUB_RESOURCE_MATCH
means
compRes
is the sub resource of the origRes
ResourceMatch.SUPER_RESOURCE_MATCH
means
compRes
is the super resource of the
origRes
ResourceMatch.WILDCARD_MATCH
means two resources match
with respect to the wildcard
public Set<String> getServiceTypeNames()
BaseResourceName
getServiceTypeNames
in interface BaseResourceName<ResourceMatch,EntitlementException>
public String[] split(String res)
BaseResourceName
split
in interface BaseResourceName<ResourceMatch,EntitlementException>
res
- name of the resource to be splitCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.