public class LdapAdapter extends Object implements TokenStorageAdapter
Constructor and Description |
---|
LdapAdapter(LdapTokenAttributeConversion conversion,
LdapQueryFilterVisitor queryConverter,
LdapQueryFactory queryFactory,
LdapConnectionFactoryProvider connectionFactoryProvider,
Map<org.forgerock.util.Option<?>,LdapOptionFunction> optionFunctionMap)
Create an instance of this adapter.
|
Modifier and Type | Method and Description |
---|---|
Token |
create(Token token,
org.forgerock.util.Options options)
Create the Token in LDAP.
|
PartialToken |
delete(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.
|
Token |
read(String tokenId,
org.forgerock.util.Options options)
Performs a read against the LDAP 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,
org.forgerock.util.Options options)
Update the Token based on whether there were any changes between the two.
|
@Inject public LdapAdapter(LdapTokenAttributeConversion conversion, LdapQueryFilterVisitor queryConverter, LdapQueryFactory queryFactory, LdapConnectionFactoryProvider connectionFactoryProvider, Map<org.forgerock.util.Option<?>,LdapOptionFunction> optionFunctionMap)
conversion
- Non null, required for Token conversion.queryConverter
- For converting between CTS and LDAP.queryFactory
- Produces queries.connectionFactoryProvider
- Produces connection factories for connections to the datastore.public Token create(Token token, org.forgerock.util.Options options) throws DataLayerException
create
in interface TokenStorageAdapter
token
- Non null Token to create.options
- Non null Options for the operations.Token
with the ETag set.DataLayerException
- If the operation failed, this exception will capture the reason.public Token read(String tokenId, org.forgerock.util.Options options) throws DataLayerException
read
in interface TokenStorageAdapter
tokenId
- The id of the Token to read.options
- Non null Options for the operations.DataLayerException
- If the operation failed, this exception will capture the reason.public Token update(Token previous, Token updated, org.forgerock.util.Options options) throws DataLayerException
If the previous Token
contains a non-null
CoreTokenField.ETAG
attribute value then the update will be performed with an
optimistic concurrency check. If it does not contain the attribute or it contains a
null
value the update will be performed without any concurrency checks.
update
in interface TokenStorageAdapter
previous
- The non null previous Token to check against.options
- The non null Options for the operation.updated
- The non null Token to update with.OptimisticConcurrencyCheckFailedException
- If the operation failed due to an
assertion on the tokens ETag. Only possible if the CoreTokenField.ETAG
attribute is
present on the previous token.DataLayerException
- If the operation failed for a known reason.public PartialToken delete(String tokenId, org.forgerock.util.Options options) throws DataLayerException
If the etag parameter is a non-null
value then the delete will be
performed with an optimistic concurrency check. If it is null
then the delete will
be performed without any concurrency checks.
delete
in interface TokenStorageAdapter
tokenId
- The non null Token ID to delete.options
- The non null Options for the operation.PartialToken
containing at least the CoreTokenField.TOKEN_ID
.DataLayerException
- If the operation failed, this exception will capture the reason.OptimisticConcurrencyCheckFailedException
- If the operation failed due to an assertion on the tokens ETag.public Collection<Token> query(TokenFilter query) throws DataLayerException
TokenStorageAdapter
query
in interface TokenStorageAdapter
query
- The non null filter specification.DataLayerException
- If the operation failed, this exception will capture the reason.public Collection<PartialToken> partialQuery(TokenFilter query) throws DataLayerException
TokenStorageAdapter
partialQuery
in interface TokenStorageAdapter
query
- The non null filter specification.DataLayerException
- If the operation failed, this exception will capture the reason.public ContinuousQuery startContinuousQuery(TokenFilter filter, ContinuousQueryListener listener) throws DataLayerException
TokenStorageAdapter
startContinuousQuery
in interface TokenStorageAdapter
filter
- The non null filter specification.DataLayerException
- If the operation failed, this exception will capture the reason.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.