Interface DelegationDataAccessProvider

All Superinterfaces:
DataAccessProvider

public interface DelegationDataAccessProvider extends DataAccessProvider
The DelegationDataAccessProvider is responsible for communicating with a Delegation data source.
  • Field Details

    • _logger

      static final Logger _logger
  • Method Details

    • getById

      Retrieve the Delegation instance based on the provided id.
      Parameters:
      id - Id of the Delegation
      Returns:
      instantiated Delegation instance
    • getByAuthorizationCodeHash

      @Nullable default @Nullable Delegation getByAuthorizationCodeHash(String authorizationCodeHash)
      Retrieve the Delegation instance based on the provided authorization code hash.

      To maintain backward compatibility, this method is optional to implement, where the default behavior is to never find a Delegation for an authorization code hash (i.e. by returning null)

      The effect of this is that a compromised client that submits the same authorization code twice or an intercepted authorization code will not be detected. As a result, tokens will not be revoked despite a compromise. For this reason, implementers are highly recommended to override this method.

      Parameters:
      authorizationCodeHash - Authorization Code hash of the delegation
      Returns:
      Delegation instance for this hash, or null if none existed
    • create

      void create(Delegation delegation)
      Create a new Delegation from the provided instance.
      Parameters:
      delegation - Delegation instance to store
    • setStatus

      long setStatus(String id, DelegationStatus status)
      Sets the status of the Delegation with the given ID.
      Parameters:
      id - Id of Delegation to be updated.
      status - to set
      Returns:
      the number of records that were updated.
    • getByOwner

      Collection<? extends Delegation> getByOwner(String owner, long startIndex, long count)
      Get all delegations associated with a user.
      Parameters:
      owner - username of owner
      startIndex - what index to start returning results from
      count - the max number of results to return
      Returns:
      List of delegations
    • getCountByOwner

      long getCountByOwner(String owner)
      Get the count of all delegations by owner.
      Parameters:
      owner - username of owner
      Returns:
      number of delegations by the owner
    • getAllActive

      Collection<? extends Delegation> getAllActive(long startIndex, long count)
      Get all active delegations in the database.
      Parameters:
      startIndex - From what index to start returning delegations
      count - The max number of delegations to return
      Returns:
      List of delegations
    • getCountAllActive

      long getCountAllActive()
      Get the count of all active delegations.
      Returns:
      the number of all active delegations
    • getAll

      Collection<? extends Delegation> getAll(ResourceQuery query)
      Get all delegations based on the provided resource query.
      Parameters:
      query - The resource query to use for fetching delegations
      Returns:
      A collection of delegations matching the query, empty if none matched
      Since:
      3.0.0