public final class EntitlementRegistry extends Object
ServiceLoader
mechanism to allow additional entitlement condition and subject implementations
to be registered by client extensions (see EntitlementModule
).Constructor and Description |
---|
EntitlementRegistry() |
Modifier and Type | Method and Description |
---|---|
String |
getAttributeName(ResourceAttribute attribute)
Returns the short name that the given attribute is registered under.
|
Set |
getAttributesShortNames()
Returns all the short names of
ResourceAttribute s currently registered in
this EntitlementRegistry . |
Class<? extends ResourceAttribute> |
getAttributeType(String name)
Returns the attribute type associated with the given short name, or null if no such attribute is registered.
|
Set |
getCombinersShortNames()
Returns all the short names of
EntitlementCombiner s currently registered in
this EntitlementRegistry . |
Class<?> |
getCombinerType(String name)
Returns the combiner associated with the given short name.
|
String |
getConditionName(EntitlementCondition condition)
Returns the short name that the given condition is registered under.
|
Set |
getConditionsShortNames()
Returns all the short names of
EntitlementCondition s currently registered in
this EntitlementRegistry . |
Class<? extends EntitlementCondition> |
getConditionType(String name)
Returns the condition type associated with the given short name, or null if no such condition is registered.
|
String |
getSubjectName(EntitlementSubject subject)
Returns the short name that the given subject is registered under.
|
Set |
getSubjectsShortNames()
Returns all the short names of
EntitlementSubject s currently registered in
this EntitlementRegistry . |
Class<? extends EntitlementSubject> |
getSubjectType(String name)
Returns the subject type associated with the given short name, or null if no such subject is registered.
|
static EntitlementRegistry |
load()
Loads all available
EntitlementModule instances and registers them with a new entitlement registry. |
void |
registerAttributeType(Class<? extends ResourceAttribute> type)
Registers a resource attribute type using a short name generated from the type name.
|
void |
registerAttributeType(String name,
Class<? extends ResourceAttribute> type)
Registers a resource attribute type with the given short name (used in RESTful API calls and in the UI).
|
void |
registerConditionType(Class<? extends EntitlementCondition> type)
Registers an entitlement condition type using a short name generated from the type name.
|
void |
registerConditionType(String name,
Class<? extends EntitlementCondition> type)
Registers an entitlement condition type with the given short name (used in RESTful API calls and in the UI).
|
void |
registerDecisionCombiner(Class<?> type)
Registers an entitlement combiner.
|
void |
registerDecisionCombiner(String name,
Class<?> type)
Registers an entitlement combiner with a given name.
|
void |
registerSubjectType(Class<? extends EntitlementSubject> type)
Registers an entitlement subject type using a short name generated from the type name.
|
void |
registerSubjectType(String name,
Class<? extends EntitlementSubject> type)
Registers an entitlement subject type with the given short name (used in RESTful API calls and in the UI).
|
public EntitlementRegistry()
public static EntitlementRegistry load()
EntitlementModule
instances and registers them with a new entitlement registry.
Each invocation of this method will attempt to load any known entitlement modules as per
ServiceLoader.load(Class)
. Previously loaded modules will be cached but any newly available modules
will be loaded.public void registerConditionType(String name, Class<? extends EntitlementCondition> type)
name
- the short name of the condition type.type
- the condition type to register.NameAlreadyRegisteredException
- if the short name is already registered.public void registerConditionType(Class<? extends EntitlementCondition> type)
Condition
suffix. For example, a condition
type org.forgerock.openam.entitlement.TestCondition
would be registered with the short name Test
.type
- the condition type to register.NameAlreadyRegisteredException
- if the short name is already registered.public Class<? extends EntitlementCondition> getConditionType(String name)
name
- the short name of the condition type to get.public void registerDecisionCombiner(Class<?> type)
type
- the condition type to register.NameAlreadyRegisteredException
- if the short name is already registered.public void registerDecisionCombiner(String name, Class<?> type)
type
- the combiner type to register.NameAlreadyRegisteredException
- if the short name is already registered.public Class<?> getCombinerType(String name)
name
- the short name of the combiner type to get.public void registerSubjectType(String name, Class<? extends EntitlementSubject> type)
name
- the short name of the subject type.type
- the subject type to register.NameAlreadyRegisteredException
- if the short name is already registered.public void registerSubjectType(Class<? extends EntitlementSubject> type)
Subject
suffix. For example, a subject
type org.forgerock.openam.entitlement.TestSubject
would be registered with the short name Test
.type
- the subject type to register.NameAlreadyRegisteredException
- if the short name is already registered.public Class<? extends EntitlementSubject> getSubjectType(String name)
name
- the short name of the subject type to get.public void registerAttributeType(String name, Class<? extends ResourceAttribute> type)
name
- the short name of the attribute type.type
- the attribute type to register.NameAlreadyRegisteredException
- if the short name is already registered.public void registerAttributeType(Class<? extends ResourceAttribute> type)
Attribute
suffix. For example, an attribute
type org.forgerock.openam.entitlement.TestAttribute
would be registered with the short name Test
.type
- the attribute type to register.NameAlreadyRegisteredException
- if the short name is already registered.public Class<? extends ResourceAttribute> getAttributeType(String name)
name
- the short name of the attribute type to get.public String getConditionName(EntitlementCondition condition)
condition
- the condition to get a short name for.public String getSubjectName(EntitlementSubject subject)
subject
- the subject to get a short name for.public String getAttributeName(ResourceAttribute attribute)
attribute
- the attribute to get a short name for.public Set getConditionsShortNames()
EntitlementCondition
s currently registered in
this EntitlementRegistry
.public Set getSubjectsShortNames()
EntitlementSubject
s currently registered in
this EntitlementRegistry
.public Set getAttributesShortNames()
ResourceAttribute
s currently registered in
this EntitlementRegistry
.public Set getCombinersShortNames()
EntitlementCombiner
s currently registered in
this EntitlementRegistry
.Copyright © 2010-2014, ForgeRock All Rights Reserved.