Class TokenDataStore<T>

  • Type Parameters:
    T - The object type being stored.

    public class TokenDataStore<T>
    extends Object
    A generic token store that can read an write a java bean, T, that has annotations to support conversion to and from a Token.
    • Constructor Detail

      • TokenDataStore

        public TokenDataStore​(JavaBeanAdapter<T> adapter,
                              TaskExecutor taskExecutor,
                              TaskFactory taskFactory)
        Create a new TokenDataStore. This could be called from an extension class, or constructed as a raw store.
        Parameters:
        adapter - The Java bean token adapter for the type of bean being stored as tokens.
        taskExecutor - The data layer task executor, for executing operations on the data store. Should be a SimpleTaskExecutor.
        taskFactory - The task factory for creating data store operations.
    • Method Detail

      • create

        public void create​(T obj)
                    throws ServerException
        Create an object. The id field will be populated with the resulting identifier.
        Parameters:
        obj - The object being created.
        Throws:
        ServerException - When an error occurs during creation.
      • query

        public Set<T> query​(org.forgerock.util.query.QueryFilter<String> query)
                     throws ServerException
        Query the store for instances.
        Parameters:
        query - The criteria of the query, using T bean property names as fields.
        Returns:
        A set of all matching objects.
        Throws:
        ServerException - When an error occurs when querying the store.