Interface DelegationDataAccessProvider
- All Superinterfaces:
DataAccessProvider
The DelegationDataAccessProvider is responsible for communicating with a
Delegation data source.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(Delegation delegation) Create a new Delegation from the provided instance.Collection<? extends Delegation>getAll(ResourceQuery query) Get all delegations based on the provided resource query.Collection<? extends Delegation>getAllActive(long startIndex, long count) Get all active delegations in the database.default @Nullable DelegationgetByAuthorizationCodeHash(String authorizationCodeHash) Retrieve the Delegation instance based on the provided authorization code hash.Retrieve the Delegation instance based on the provided id.Collection<? extends Delegation>getByOwner(String owner, long startIndex, long count) Get all delegations associated with a user.longGet the count of all active delegations.longgetCountByOwner(String owner) Get the count of all delegations by owner.longsetStatus(String id, DelegationStatus status) Sets the status of the Delegation with the given ID.Methods inherited from interface se.curity.identityserver.sdk.datasource.DataAccessProvider
isThreadSafe
-
Field Details
-
_logger
-
-
Method Details
-
getById
Retrieve the Delegation instance based on the provided id.- Parameters:
id- Id of the Delegation- Returns:
- instantiated Delegation instance
-
getByAuthorizationCodeHash
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
Create a new Delegation from the provided instance.- Parameters:
delegation- Delegation instance to store
-
setStatus
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
Get all delegations associated with a user.- Parameters:
owner- username of ownerstartIndex- what index to start returning results fromcount- the max number of results to return- Returns:
- List of delegations
-
getCountByOwner
Get the count of all delegations by owner.- Parameters:
owner- username of owner- Returns:
- number of delegations by the owner
-
getAllActive
Get all active delegations in the database.- Parameters:
startIndex- From what index to start returning delegationscount- 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
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
-