Interface ResourceTypeConfiguration

  • All Known Implementing Classes:
    ResourceTypeConfigurationImpl

    public interface ResourceTypeConfiguration
    Implementations of this interface are responsible for the persistence of the resource type entitlement configuration.
    • Method Detail

      • getResourceType

        ResourceType getResourceType​(Subject subject,
                                     String realm,
                                     String uuid)
                              throws EntitlementException
        Retrieve a registered resource type by id.
        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

        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.
        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

        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.
        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

        void removeResourceType​(Subject subject,
                                String realm,
                                String uuid)
                         throws EntitlementException
        Remove a resource type.
        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

        void storeResourceType​(Subject subject,
                               String realm,
                               ResourceType resourceType)
                        throws EntitlementException
        Stores the resource type to the data store.
        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

        Set<ResourceType> getResourceTypes​(org.forgerock.util.query.QueryFilter<SmsAttribute> filter,
                                           Subject subject,
                                           String realm)
                                    throws EntitlementException
        Retrieves a set of resource types based on the passed query filter.
        Parameters:
        filter - the query filter
        subject - the calling subject
        realm - the realm to look within
        Returns:
        a set of matching resource types
        Throws:
        EntitlementException - should an error occur during lookup
      • getResourceTypesData

        Map<String,​Map<String,​Set<String>>> getResourceTypesData​(Subject subject,
                                                                             String realm)
                                                                      throws EntitlementException
        Retrieve the resource types stored under the specified realm from the data store.
        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.