Class ResourceTypeConfigurationImpl
- java.lang.Object
-
- org.forgerock.openam.entitlement.configuration.ResourceTypeConfigurationImpl
-
- All Implemented Interfaces:
ResourceTypeConfiguration
public class ResourceTypeConfigurationImpl extends Object implements ResourceTypeConfiguration
The implementation forResourceTypeConfigurationthat is responsible for the persistence of the resource type entitlement configuration.- Since:
- 13.0.0
-
-
Constructor Summary
Constructors Constructor Description ResourceTypeConfigurationImpl(DNWrapper dnHelper, ResourceTypeServiceConfig resourceTypeServiceConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsName(Subject subject, String realm, String name)Check to see if a resource type with the given name already exists in this realm.booleancontainsUUID(Subject subject, String realm, String uuid)Check to see if a resource type with the given UUID already exists in this realm.ResourceTypegetResourceType(Subject subject, String realm, String uuid)Retrieve a registered resource type by id.Set<ResourceType>getResourceTypes(org.forgerock.util.query.QueryFilter<SmsAttribute> queryFilter, Subject subject, String realm)Retrieves a set of resource types based on the passed query filter.Map<String,Map<String,Set<String>>>getResourceTypesData(Subject subject, String realm)Retrieve the resource types stored under the specified realm from the data store.voidremoveResourceType(Subject subject, String realm, String uuid)Remove a resource type.voidstoreResourceType(Subject subject, String realm, ResourceType resourceType)Stores the resource type to the data store.
-
-
-
Constructor Detail
-
ResourceTypeConfigurationImpl
@Inject public ResourceTypeConfigurationImpl(DNWrapper dnHelper, ResourceTypeServiceConfig resourceTypeServiceConfig)
-
-
Method Detail
-
getResourceType
public ResourceType getResourceType(Subject subject, String realm, String uuid) throws EntitlementException
Retrieve a registered resource type by id.- Specified by:
getResourceTypein interfaceResourceTypeConfiguration- Parameters:
subject- The subject for whom the resource type should be retrieved.realm- The realm in which the resource type resides.uuid- The unique identifier for the resource type.- Returns:
- The registered resource type.
- Throws:
EntitlementException- If the retrieval of the resource type failed.
-
containsUUID
public boolean containsUUID(Subject subject, String realm, String uuid) throws EntitlementException
Check to see if a resource type with the given UUID already exists in this realm.- Specified by:
containsUUIDin interfaceResourceTypeConfiguration- Parameters:
subject- The subject for whom the resource type should be retrieved.realm- The realm in which the resource type resides.uuid- The unique identifier for the resource type.- Returns:
- True if the resource type already exists.
- Throws:
EntitlementException
-
containsName
public boolean containsName(Subject subject, String realm, String name) throws EntitlementException
Check to see if a resource type with the given name already exists in this realm.- Specified by:
containsNamein interfaceResourceTypeConfiguration- Parameters:
subject- The subject for whom the resource type should be retrieved.realm- The realm in which the resource type resides.name- The name of the resource type.- Returns:
- True if the resource type already exists.
- Throws:
EntitlementException
-
removeResourceType
public void removeResourceType(Subject subject, String realm, String uuid) throws EntitlementException
Remove a resource type.- Specified by:
removeResourceTypein interfaceResourceTypeConfiguration- Parameters:
subject- The subject for whom the resource type should be removed.realm- The realm in which the resource type resides.uuid- The unique identifier for the resource type.- Throws:
EntitlementException- if the resource type cannot be removed.
-
storeResourceType
public void storeResourceType(Subject subject, String realm, ResourceType resourceType) throws EntitlementException
Stores the resource type to the data store.- Specified by:
storeResourceTypein interfaceResourceTypeConfiguration- Parameters:
subject- The subject for whom the resource type should be stored.realm- The realm in which the resource type resides.resourceType- The resource type to store.- Throws:
EntitlementException- if the resource type cannot be stored.
-
getResourceTypes
public Set<ResourceType> getResourceTypes(org.forgerock.util.query.QueryFilter<SmsAttribute> queryFilter, Subject subject, String realm) throws EntitlementException
Description copied from interface:ResourceTypeConfigurationRetrieves a set of resource types based on the passed query filter.- Specified by:
getResourceTypesin interfaceResourceTypeConfiguration- Parameters:
queryFilter- the query filtersubject- the calling subjectrealm- the realm to look within- Returns:
- a set of matching resource types
- Throws:
EntitlementException- should an error occur during lookup
-
getResourceTypesData
public Map<String,Map<String,Set<String>>> getResourceTypesData(Subject subject, String realm) throws EntitlementException
Description copied from interface:ResourceTypeConfigurationRetrieve the resource types stored under the specified realm from the data store.- Specified by:
getResourceTypesDatain interfaceResourceTypeConfiguration- Parameters:
subject- The subject with privilege to access the resource types in this realm.realm- The realm from which to retrieve the resource types.- Returns:
- The registered resource types in a map. The outer map holds the resource type UUID as the key. The inner map (value of the outer map) holds the names of the attributes of the resource type as keys and a set of values for that attribute as the value.
- Throws:
EntitlementException- If the retrieval of the resource type failed.
-
-