Interface TokenStorageAdapter
-
- All Known Implementing Classes:
LdapAdapter,TokenStorageAdapter
public interface TokenStorageAdapterAdapts the token to some activity against the connection type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tokencreate(Token token, org.forgerock.util.Options options)Create the Token in the database.PartialTokendelete(String tokenId, org.forgerock.util.Options options)Performs a delete against the Token ID provided.Collection<PartialToken>partialQuery(TokenFilter query)Performs a partial query using the provided filter.Collection<Token>query(TokenFilter query)Performs a full-token query using the provided filter.Tokenread(String tokenId, org.forgerock.util.Options options)Performs a read against the database connection and converts the result into a Token.ContinuousQuerystartContinuousQuery(TokenFilter filter, ContinuousQueryListener listener)Performs a continuous query using the provided filter.Tokenupdate(Token previous, Token updated, org.forgerock.util.Options options)Update the Token based on whether there were any changes between the two.
-
-
-
Method Detail
-
create
Token create(Token token, org.forgerock.util.Options options) throws DataLayerException
Create the Token in the database.- Parameters:
token- Non null Token to create.options- Non null Options for the operations.- Returns:
- token The instance of the newly created token. The newly created token would contain the additional etag information.
- Throws:
DataLayerException- If the operation failed for a known reason.
-
read
Token read(String tokenId, org.forgerock.util.Options options) throws DataLayerException
Performs a read against the database connection and converts the result into a Token.- Parameters:
tokenId- The id of the Token to read.options- Non null Options for the operations.- Returns:
- Token if found, otherwise null.
- Throws:
DataLayerException
-
update
Token update(Token previous, Token updated, org.forgerock.util.Options options) throws DataLayerException
Update the Token based on whether there were any changes between the two.- Parameters:
previous- The non null previous Token to check against.updated- The non null Token to update with.options- The non null Options for the operation.- Returns:
- A copy of the updated token. The token would contain the updated etag.
- Throws:
DataLayerException- If the operation failed for a known reason.OptimisticConcurrencyCheckFailedException- If the operation failed due to an assertion on the tokens ETag.
-
delete
PartialToken delete(String tokenId, org.forgerock.util.Options options) throws DataLayerException
Performs a delete against the Token ID provided.- Parameters:
tokenId- The non null Token ID to delete.options- The non null Options for the operation.- Returns:
- A
PartialTokencontaining at least theCoreTokenField.TOKEN_ID. - Throws:
LdapOperationFailedException- If the operation failed, this exception will capture the reason.OptimisticConcurrencyCheckFailedException- If the operation failed due to an assertion on the tokens ETag.DataLayerException
-
query
Collection<Token> query(TokenFilter query) throws DataLayerException
Performs a full-token query using the provided filter.- Parameters:
query- The non null filter specification.- Throws:
DataLayerException- If the operation failed, this exception will capture the reason.
-
partialQuery
Collection<PartialToken> partialQuery(TokenFilter query) throws DataLayerException
Performs a partial query using the provided filter.- Parameters:
query- The non null filter specification.- Throws:
DataLayerException- If the operation failed, this exception will capture the reason.
-
startContinuousQuery
ContinuousQuery startContinuousQuery(TokenFilter filter, ContinuousQueryListener listener) throws DataLayerException
Performs a continuous query using the provided filter.- Parameters:
filter- The non null filter specification.- Throws:
DataLayerException- If the operation failed, this exception will capture the reason.
-
-