Interface ScopeStore


public interface ScopeStore
A ScopeStore is responsible to manage the persistence of Scope instances.
Author:
Pedro Igor
  • Method Details

    • create

      default Scope create(ResourceServer resourceServer, String name)
      Creates a new Scope instance. The new instance is not necessarily persisted though, which may require a call to the {#save} method to actually make it persistent.
      Parameters:
      resourceServer - the resource server to which this scope belongs. Cannot be null.
      name - the name of the scope
      Returns:
      a new instance of Scope
    • create

      Scope create(ResourceServer resourceServer, String id, String name)
      Creates a new Scope instance. The new instance is not necessarily persisted though, which may require a call to the {#save} method to actually make it persistent.
      Parameters:
      resourceServer - the resource server to which this scope belongs. Cannot be null.
      id - the id of the scope. Is generated randomly when null
      name - the name of the scope
      Returns:
      a new instance of Scope
    • delete

      void delete(RealmModel realm, String id)
      Deletes a scope from the underlying persistence mechanism.
      Parameters:
      realm - the realm. Cannot be null.
      id - the id of the scope to delete
    • findById

      Scope findById(RealmModel realm, ResourceServer resourceServer, String id)
      Returns a Scope with the given id
      Parameters:
      realm - the realm. Cannot be null.
      resourceServer - the resource server id. Ignored if null.
      id - the identifier of the scope
      Returns:
      a scope with the given identifier.
    • findByName

      Scope findByName(ResourceServer resourceServer, String name)
      Returns a Scope with the given name
      Parameters:
      resourceServer - the resource server. Cannot be null.
      name - the name of the scope
      Returns:
      a scope with the given name.
    • findByResourceServer

      List<Scope> findByResourceServer(ResourceServer resourceServer)
      Returns a list of Scope associated with the ResourceServer.
      Parameters:
      resourceServer - the resource server. Cannot be null.
      Returns:
      a list of scopes that belong to the given resource server
    • findByResourceServer

      List<Scope> findByResourceServer(ResourceServer resourceServer, Map<Scope.FilterOption,String[]> attributes, Integer firstResult, Integer maxResults)
      Returns a list of Scope associated with a ResourceServer with the given resourceServerId.
      Parameters:
      resourceServer - the resource server. Cannot be null.
      attributes - a map holding the attributes that will be used as a filter; possible filter options are given by Scope.FilterOption
      firstResult - first result to return. Ignored if negative or null.
      maxResults - maximum number of results to return. Ignored if negative or null.
      Returns:
      a list of scopes that belong to the given resource server
      Throws:
      IllegalArgumentException - when there is an unknown attribute in the attributes map