Interface ScopeStore

    • Method Detail

      • create

        default Scope create​(String name,
                             ResourceServer resourceServer)
        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:
        name - the name of the scope
        resourceServer - the resource server to which this scope belongs
        Returns:
        a new instance of Scope
      • create

        Scope create​(String id,
                     String name,
                     ResourceServer resourceServer)
        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:
        id - the id of the scope. Is generated randomly when null
        name - the name of the scope
        resourceServer - the resource server to which this scope belongs
        Returns:
        a new instance of Scope
      • delete

        void delete​(String id)
        Deletes a scope from the underlying persistence mechanism.
        Parameters:
        id - the id of the scope to delete
      • findById

        Scope findById​(String id,
                       String resourceServerId)
        Returns a Scope with the given id
        Parameters:
        id - the identifier of the scope
        resourceServerId - the resource server id
        Returns:
        a scope with the given identifier.
      • findByName

        Scope findByName​(String name,
                         String resourceServerId)
        Returns a Scope with the given name
        Parameters:
        name - the name of the scope
        resourceServerId - the resource server id
        Returns:
        a scope with the given name.
      • findByResourceServer

        List<Scope> findByResourceServer​(String id)
        Returns a list of Scope associated with a ResourceServer with the given resourceServerId.
        Parameters:
        resourceServerId - the identifier of a resource server
        Returns:
        a list of scopes that belong to the given resource server
      • findByResourceServer

        List<Scope> findByResourceServer​(Map<Scope.FilterOption,​String[]> attributes,
                                         String resourceServerId,
                                         int firstResult,
                                         int maxResult)
        Returns a list of Scope associated with a ResourceServer with the given resourceServerId.
        Parameters:
        attributes - a map holding the attributes that will be used as a filter; possible filter options are given by Scope.FilterOption
        resourceServerId - the identifier of a resource server
        Returns:
        a list of scopes that belong to the given resource server
        Throws:
        IllegalArgumentException - when there is an unknown attribute in the attributes map