public class LDAPStorageService extends AbstractStorageService implements StorageCapabilitiesEx
StorageService that stores data in an LDAP. Does not support
expiration or versioning at this time.| Modifier and Type | Field and Description |
|---|---|
private PooledConnectionFactory |
connectionFactory
LDAP connection factory.
|
private LdapAttribute[] |
defaultAttributes
Attributes to include in merge operations.
|
private Logger |
log
Class logger.
|
| Constructor and Description |
|---|
LDAPStorageService(PooledConnectionFactory factory,
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 Response<Void> |
delete(String dn)
Executes a
DeleteOperation on the supplied DN. |
boolean |
delete(String context,
String key) |
private 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() |
boolean |
isClustered() |
boolean |
isServerSide() |
private Response<Void> |
merge(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 Response<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, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContextSize, getKeySize, getValueSizeprivate final Logger log
private PooledConnectionFactory connectionFactory
private LdapAttribute[] defaultAttributes
public LDAPStorageService(@Nonnull PooledConnectionFactory factory, LdapAttribute... attrs)
factory - to retrieve LDAP connections fromattrs - to include in all LDAP entriespublic boolean isServerSide()
isServerSide in interface StorageCapabilitiesExpublic boolean isClustered()
isClustered in interface StorageCapabilitiesExprotected 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
create in interface StorageServiceIOException@Nullable public StorageRecord read(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key) throws IOException
read in interface StorageServiceIOException@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
read in interface StorageServiceIOExceptionpublic boolean update(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nonnull@NotEmpty String value, @Nullable@Positive Long expiration) throws IOException
update in interface StorageServiceIOException@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
updateWithVersion in interface StorageServiceIOExceptionVersionMismatchExceptionpublic boolean updateExpiration(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nullable@Positive Long expiration) throws IOException
updateExpiration in interface StorageServiceIOExceptionpublic boolean delete(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key) throws IOException
delete in interface StorageServiceIOExceptionpublic boolean deleteWithVersion(@Positive
long version,
@Nonnull@NotEmpty
String context,
@Nonnull@NotEmpty
String key)
throws IOException,
VersionMismatchException
deleteWithVersion in interface StorageServiceIOExceptionVersionMismatchExceptionpublic void reap(@Nonnull@NotEmpty String context) throws IOException
reap in interface StorageServiceIOExceptionpublic void updateContextExpiration(@Nonnull@NotEmpty String context, @Nullable@Positive Long expiration) throws IOException
updateContextExpiration in interface StorageServiceIOExceptionpublic void deleteContext(@Nonnull@NotEmpty String context) throws IOException
deleteContext in interface StorageServiceIOException@Nonnull private Response<Void> merge(@Nonnull LdapEntry entry) throws LdapException
MergeOperation with the supplied entry.entry - to mergeLdapException - if the operation fails@Nonnull private Response<SearchResult> search(@Nonnull String dn, String... attrs) throws LdapException
SearchOperation on the supplied DN, returning the supplied attributes.dn - to search onattrs - to returnLdapException - if the operation fails@Nonnull private Response<Void> deleteAttribute(@Nonnull String dn, @Nonnull String attrName) throws LdapException
ModifyOperation on the supplied DN, removing the supplied attribute.dn - to modifyattrName - to removeLdapException - if the operation fails@Nonnull private Response<Void> delete(@Nonnull String dn) throws LdapException
DeleteOperation on the supplied DN.dn - to deleteLdapException - if the operation failsCopyright © 1999–2016 Shibboleth Consortium. All rights reserved.