T
- The type that the compare method is going to return instances of.E
- The exception type thrown by the canonicalize method.public interface BaseResourceName<T,E extends Exception>
ResourceName
provides
methods to determine the hierarchy of resource names.
It provides methods to compare resources, get sub resources etc.
Also it provides an interface to determine the service
type to which it be used. Service developers could
provide an implementation of this interface that will
determine its hierarchy during policy evaluation and
also its display in the GUI. A class that implements
this interface must have a empty constructor.Modifier and Type | Method and Description |
---|---|
String |
append(String superResource,
String subResource)
Appends sub-resource to super-resource.
|
String |
canonicalize(String res)
Gets the canonicalized form of a resource string.
|
T |
compare(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.
|
String |
getSubResource(String res,
String superRes)
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.
|
String[] |
split(String res)
Method to split a resource into the smallest necessary
sub resource units.
|
Set<String> getServiceTypeNames()
void initialize(Map configParams)
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.T compare(String origRes, String compRes, boolean wildcardCompare)
origRes
- name of the resource which will be comparedcompRes
- 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
String append(String superResource, String subResource)
superResource
- name of the super-resource to be appended to.subResource
- name of the sub-resource to be appended.String getSubResource(String res, String superRes)
res
- name of the original resource consisting of
the second parameter superRes
and the returned valuesuperRes
- name of the super-resource which the first
parameter begins with.String canonicalize(String res) throws E extends Exception
String[] split(String res)
res
- name of the resource to be splitCopyright © 2010-2018, ForgeRock All Rights Reserved.