Package org.forgerock.am.cts.api
Interface TokenStorageAdapter
-
public interface TokenStorageAdapter
Adapts the token to some activity against the connection type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Token
create(Token token, Options options)
Create the Token in the database.PartialToken
delete(String tokenId, Options options)
Performs a delete against the Token ID provided.Collection<PartialToken>
partialQuery(TokenFilter query, Options options)
Performs a partial query using the provided filter.PartialToken
patch(String tokenId, TokenModifications modifications, Options options)
Performs a patch against the Token ID provided.Collection<Token>
query(TokenFilter query, Options options)
Performs a full-token query using the provided filter.Token
read(String tokenId, Options options)
Performs a read against the database connection and converts the result into a Token.ContinuousQuery
startContinuousQuery(TokenFilter filter, ContinuousQueryListener listener)
Performs a continuous query using the provided filter.Token
update(Token previous, Token updated, Options options)
Update the Token based on whether there were any changes between the two.
-
-
-
Method Detail
-
create
Token create(Token token, Options options) throws DataLayerException
Create the Token in the database.- Parameters:
token
- Non null Token to create.options
- Non nullOptions
to pass through to the underlying implementation.- 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, 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 nullOptions
to pass through to the underlying implementation.- Returns:
- Token if found, otherwise null.
- Throws:
DataLayerException
-
update
Token update(Token previous, Token updated, 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
- Non nullOptions
to pass through to the underlying implementation.- Returns:
- A copy of the updated token. The token would contain the updated etag.
- Throws:
DataLayerException
- If the operation failed for a known reason.
-
delete
PartialToken delete(String tokenId, Options options) throws DataLayerException
Performs a delete against the Token ID provided.- Parameters:
tokenId
- The non null Token ID to delete.options
- Non nullOptions
to pass through to the underlying implementation.- Returns:
- A
PartialToken
containing at least theCoreTokenField.TOKEN_ID
. - Throws:
DataLayerException
- If the operation failed, this exception will capture the reason.
-
patch
PartialToken patch(String tokenId, TokenModifications modifications, Options options) throws DataLayerException
Performs a patch against the Token ID provided.- Parameters:
tokenId
- The ID of the token to patch.options
- Non nullOptions
to pass through to the underlying implementation.- Returns:
- A
PartialToken
containing at least theCoreTokenField.TOKEN_ID
. - Throws:
DataLayerException
- If the operation failed, this exception will capture the reason.
-
query
Collection<Token> query(TokenFilter query, Options options) throws DataLayerException
Performs a full-token query using the provided filter.- Parameters:
query
- The non null filter specification.options
- Non nullOptions
to pass through to the underlying implementation.- Throws:
DataLayerException
- If the operation failed, this exception will capture the reason.
-
partialQuery
Collection<PartialToken> partialQuery(TokenFilter query, Options options) throws DataLayerException
Performs a partial query using the provided filter.- Parameters:
query
- The non null filter specification.options
- Non nullOptions
to pass through to the underlying implementation.- 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.
-
-