public class LDAPStorageService extends AbstractStorageService
StorageService that stores data in an LDAP. Does not support
expiration or versioning at this time.| Modifier and Type | Field and Description |
|---|---|
private org.ldaptive.pool.PooledConnectionFactory |
connectionFactory
LDAP connection factory.
|
private org.ldaptive.LdapAttribute[] |
defaultAttributes
Attributes to include in merge operations.
|
private Logger |
log
Class logger.
|
| Constructor and Description |
|---|
LDAPStorageService(org.ldaptive.pool.PooledConnectionFactory factory,
org.ldaptive.LdapAttribute... attrs)
Creates a new LDAP storage service.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
create(String context,
String key,
String value,
Long expiration) |
private org.ldaptive.Response<Void> |
delete(String dn)
Executes a
DeleteOperation on the supplied DN. |
boolean |
delete(String context,
String key) |
private org.ldaptive.Response<Void> |
deleteAttribute(String dn,
String attrName)
Executes a
ModifyOperation on the supplied DN, removing the supplied attribute. |
void |
deleteContext(String context) |
boolean |
deleteWithVersion(long version,
String context,
String key) |
protected void |
doDestroy() |
protected void |
doInitialize() |
private org.ldaptive.Response<Void> |
merge(org.ldaptive.LdapEntry entry)
Executes a
MergeOperation with the supplied entry. |
StorageRecord |
read(String context,
String key) |
net.shibboleth.utilities.java.support.collection.Pair<Long,StorageRecord> |
read(String context,
String key,
long version) |
void |
reap(String context) |
private org.ldaptive.Response<org.ldaptive.SearchResult> |
search(String dn,
String... attrs)
Executes a object level
SearchOperation on the supplied DN, returning the supplied attributes. |
boolean |
update(String context,
String key,
String value,
Long expiration) |
void |
updateContextExpiration(String context,
Long expiration) |
boolean |
updateExpiration(String context,
String key,
Long expiration) |
Long |
updateWithVersion(long version,
String context,
String key,
String value,
Long expiration) |
create, create, delete, deleteWithVersion, getCapabilities, getCleanupInterval, getCleanupTask, getCleanupTaskTimer, getContextSize, getKeySize, getValueSize, read, setCleanupInterval, setCleanupTaskTimer, setContextSize, setKeySize, setValueSize, update, update, updateExpiration, updateWithVersion, updateWithVersionsetIdgetIddestroy, initialize, isDestroyed, isInitializedprivate final Logger log
private org.ldaptive.pool.PooledConnectionFactory connectionFactory
private org.ldaptive.LdapAttribute[] defaultAttributes
public LDAPStorageService(@Nonnull org.ldaptive.pool.PooledConnectionFactory factory, org.ldaptive.LdapAttribute... attrs)
factory - to retrieve LDAP connections fromattrs - to include in all LDAP entriesprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class AbstractStorageServicenet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionprotected void doDestroy()
doDestroy in class AbstractStorageServicepublic boolean create(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nonnull@NotEmpty String value, @Nullable@Positive Long expiration) throws IOException
IOException@Nullable public StorageRecord read(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key) throws IOException
IOException@Nonnull public net.shibboleth.utilities.java.support.collection.Pair<Long,StorageRecord> read(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Positive long version) throws IOException
IOExceptionpublic boolean update(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nonnull@NotEmpty String value, @Nullable@Positive Long expiration) throws IOException
IOException@Nullable public Long updateWithVersion(@Positive long version, @Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nonnull@NotEmpty String value, @Nullable@Positive Long expiration) throws IOException, VersionMismatchException
IOExceptionVersionMismatchExceptionpublic boolean updateExpiration(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nullable@Positive Long expiration) throws IOException
IOExceptionpublic boolean delete(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key) throws IOException
IOExceptionpublic boolean deleteWithVersion(@Positive
long version,
@Nonnull@NotEmpty
String context,
@Nonnull@NotEmpty
String key)
throws IOException,
VersionMismatchException
IOExceptionVersionMismatchExceptionpublic void reap(@Nonnull@NotEmpty String context) throws IOException
IOExceptionpublic void updateContextExpiration(@Nonnull@NotEmpty String context, @Nullable@Positive Long expiration) throws IOException
IOExceptionpublic void deleteContext(@Nonnull@NotEmpty String context) throws IOException
IOException@Nonnull private org.ldaptive.Response<Void> merge(@Nonnull org.ldaptive.LdapEntry entry) throws org.ldaptive.LdapException
MergeOperation with the supplied entry.entry - to mergeorg.ldaptive.LdapException - if the operation fails@Nonnull private org.ldaptive.Response<org.ldaptive.SearchResult> search(@Nonnull String dn, String... attrs) throws org.ldaptive.LdapException
SearchOperation on the supplied DN, returning the supplied attributes.dn - to search onattrs - to returnorg.ldaptive.LdapException - if the operation fails@Nonnull private org.ldaptive.Response<Void> deleteAttribute(@Nonnull String dn, @Nonnull String attrName) throws org.ldaptive.LdapException
ModifyOperation on the supplied DN, removing the supplied attribute.dn - to modifyattrName - to removeorg.ldaptive.LdapException - if the operation failsCopyright © 1999–2015. All rights reserved.