public class SuffixResourceName extends Object implements ResourceName
ResourceName
interface
it provides methods to do resource comparisons and resource
handling based on suffix based string match going right to left.Constructor and Description |
---|
SuffixResourceName()
empty no argument constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
append(String superResource,
String subResource)
Appends sub-resource to super-resource.
|
String |
canonicalize(String res)
This method is used to canonicalize a suffix resource
It returns the string back as is.
|
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,
usally set by the administrators.
|
String[] |
split(String res)
Method to split a resource into the smallest necessary
sub resource units.
|
protected String wildcard
public void initialize(Map configParams)
initialize
in interface BaseResourceName<ResourceMatch,PolicyException>
configParams
- configuration parameters as a map.
The keys of the map are the configuration paramaters.
Each key is corresponding to one String
value
which specifies the configuration paramater value.public Set<String> getServiceTypeNames()
BaseResourceName
getServiceTypeNames
in interface BaseResourceName<ResourceMatch,PolicyException>
public ResourceMatch compare(String requestResource, String targetResource, boolean wildcardCompare)
compare
in interface BaseResourceName<ResourceMatch,PolicyException>
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.public String append(String superResource, String subResource)
append
in interface BaseResourceName<ResourceMatch,PolicyException>
superResource
- name of the super-resource to be appended tosubResource
- name of the sub-resource to be appendedpublic String getSubResource(String resource, String superResource)
getSubResource
in interface BaseResourceName<ResourceMatch,PolicyException>
resource
- name of the original resource consisting of
the second parameter superResource and the returned valuesuperResource
- name of the super-resource which the first
parameter begins with.public String[] split(String res)
BaseResourceName
split
in interface BaseResourceName<ResourceMatch,PolicyException>
res
- name of the resource to be splitpublic String canonicalize(String res) throws PolicyException
canonicalize
in interface BaseResourceName<ResourceMatch,PolicyException>
res
- the suffix resource string to be canonicalizedPolicyException
- if resource is invalidCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.