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 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() |
boolean |
isClustered() |
boolean |
isServerSide() |
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, updateWithVersion
setId
getId
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContextSize, getKeySize, getValueSize
private 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 entriespublic boolean isServerSide()
isServerSide
in interface StorageCapabilitiesEx
public boolean isClustered()
isClustered
in interface StorageCapabilitiesEx
protected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize
in class AbstractStorageService
net.shibboleth.utilities.java.support.component.ComponentInitializationException
protected void doDestroy()
doDestroy
in class AbstractStorageService
public boolean create(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nonnull@NotEmpty String value, @Nullable@Positive Long expiration) throws IOException
create
in interface StorageService
IOException
@Nullable public StorageRecord read(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key) throws IOException
read
in interface StorageService
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
read
in interface StorageService
IOException
public boolean update(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nonnull@NotEmpty String value, @Nullable@Positive Long expiration) throws IOException
update
in interface StorageService
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
updateWithVersion
in interface StorageService
IOException
VersionMismatchException
public boolean updateExpiration(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nullable@Positive Long expiration) throws IOException
updateExpiration
in interface StorageService
IOException
public boolean delete(@Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key) throws IOException
delete
in interface StorageService
IOException
public boolean deleteWithVersion(@Positive long version, @Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key) throws IOException, VersionMismatchException
deleteWithVersion
in interface StorageService
IOException
VersionMismatchException
public void reap(@Nonnull@NotEmpty String context) throws IOException
reap
in interface StorageService
IOException
public void updateContextExpiration(@Nonnull@NotEmpty String context, @Nullable@Positive Long expiration) throws IOException
updateContextExpiration
in interface StorageService
IOException
public void deleteContext(@Nonnull@NotEmpty String context) throws IOException
deleteContext
in interface StorageService
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–2020 Shibboleth Consortium. All rights reserved.