public class ServiceType extends Object
ServiceType
provides interfaces to
obtain information about a service, for which a policy
could be created. The information that can be obtained are
actions names (privileges) of service and its schema, whether the
service requires resource names and ResourceName
used to compare the resourcesModifier | Constructor and Description |
---|---|
protected |
ServiceType(String serviceName,
ServiceSchemaManager ssm,
ServiceSchema pschema)
Constructor used by
ServiceTypeManager
to construct an instance of ServiceType , |
Modifier and Type | Method and Description |
---|---|
String |
append(String superRes,
String subRes)
Combine super-resource and sub-resource of this service type.
|
protected ResourceMatch |
compare(String resource1,
String resource2)
Compares two resources of this service type to determine their equality.
|
protected ResourceMatch |
compare(String resource1,
String resource2,
boolean interpretWildCard)
Compares two resources of this service type to determine their equality.
|
boolean |
containsActionName(String actionName)
Returns
true is the service has the specified action name. |
Set |
getActionNames()
Returns the actions supported by the service.
|
ActionSchema |
getActionSchema(String actionName)
Returns the schema associated with the action name.
|
Map |
getActionSchemas()
Returns the action schemas for all the actions supported by
the service.
|
String |
getI18NKey()
Returns the I18N key for the service name.
|
String |
getI18NPropertiesFileName()
Returns the I18N properties file name for the service.
|
String |
getName()
Returns the name of this object
|
protected Set |
getPoliciesForExactResourceMatch(String resoruceName)
Method to identify policies that have the specified resource.
|
protected Set |
getPolicyForResource(String resourceName)
Method to identify polcies that has the specified resource
and its superior resources.
|
ResourceName |
getResourceNameComparator()
Returns
ResourceName used by this object |
String |
getSubResource(String res,
String superRes)
Method to get sub-resource from an original resource minus
a super resource.
|
boolean |
hasResourceNames()
Returns
true if the service has resource names. |
String[] |
split(String res)
Method to split a resource into the smallest possible
subresource units
|
boolean |
validateActionValues(Map actionValues)
Returns
true if the action names and its values
in the given Map are valid and satisfy the schema
for the respective action names. |
protected ServiceType(String serviceName, ServiceSchemaManager ssm, ServiceSchema pschema)
ServiceTypeManager
to construct an instance of ServiceType
,serviceName
- name of the service for which to construct
ServiceType
ssm
- ServiceTypeManager
to initialize the
the ServiceType
withpublic ResourceName getResourceNameComparator()
ResourceName
used by this objectResourceName
used by this objectpublic String getName()
public String getI18NPropertiesFileName()
null
.
Used by GUI and CLI to display the service informationpublic String getI18NKey()
null
.
Used by GUI and CLI to display the service name.public Set getActionNames()
Set
has the actions names
sorted alphabetically in the ascending order.public ActionSchema getActionSchema(String actionName) throws InvalidNameException
actionName
- name of the action for which schema
will be returned; if action name is invalid an
InvalidActioNameException
is thrownInvalidNameException
- if the action name is not a valid
action for the servicepublic Map getActionSchemas()
Map
has the action names sorted in
alphabetic ascending order.public boolean validateActionValues(Map actionValues) throws InvalidNameException
true
if the action names and its values
in the given Map
are valid and satisfy the schema
for the respective action names.actionValues
- a Map
that contains action names
as its "key" and a Set
of action values as its "value"
for the action nametrue
if the action names and its values
satisfy the action schemas for the serviceInvalidNameException
- if either the action names or action
values do not match the schema defined by the servicepublic boolean containsActionName(String actionName)
true
is the service has the specified action name.true
if the service has the action name
false
otherwiseprotected ResourceMatch compare(String resource1, String resource2)
ResourceMatch
object which
specifies if the resources match exactly, do not match, or one
of them is a subordinate resource of the other. Wildcards in
resource1 are escaped. Wildcards in resource2 are interpreted.resource1
- resource name 1resource2
- resource name 2ResourceMatch
that
specifies if the resources are exact match, or
otherwise.
Return value describes resource2
For example, if the return value is
ResourceMatch.SUPER_RESOURCE, resource2
is super resource of resource1.protected ResourceMatch compare(String resource1, String resource2, boolean interpretWildCard)
ResourceMatch
object which
specifies if the resources match exactly, do not match, or one
of them is a subordinate resource of the other. Wildcards in
resource1 are escaped. Wildcards in resource2 are interpreted.resource1
- resource name 1resource2
- resource name 2interpretWildCard
- if true
, wild cards in resource2
are interpreted. Else, the wildcards are
escaped.ResourceMatch
that
specifies if the resources are exact match, or
otherwise.
Return value describes resource2
For example, if the return value is
ResourceMatch.SUPER_RESOURCE, resource2 is
super resource of resource1.public String append(String superRes, String subRes)
superRes
- name of the resoruce which will be combined withsubRes
- name of the resource which will be combinedpublic 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.public String[] split(String res)
res
- name of the resource to be splitprotected Set getPoliciesForExactResourceMatch(String resoruceName)
protected Set getPolicyForResource(String resourceName)
public boolean hasResourceNames()
true
if the service has resource names.true
if the service has resource names;
false
otherwiseCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.