Interface BackendContext
-
@NotExtensible @ThreadSafety(level=INTERFACE_THREADSAFE) public interface BackendContext
This interface defines a set of methods that may be used to interact with a backend that has been defined in the server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
entryExists(java.lang.String dn)
Indicates whether the specified entry exists in the backend.java.lang.String
getBackendID()
Retrieves the backend ID for this backend.java.lang.String[]
getBaseDNs()
Retrieves the set of base DNs handled by the backend.Entry
getEntry(java.lang.String dn)
Retrieves the specified entry from the backend.long
getEntryCount()
Retrieves the total number of entries contained in this backend, if that information is available.BackendContext
getParentBackend()
Retrieves information about the parent for the associated backend, if any.BackendContext[]
getSubordinateBackends()
Retrieves information about any backends which are immediately subordinate to the associated backend.WritabilityMode
getWritabilityMode()
Retrieves theWritabilityMode
for the backend.boolean
handlesEntry(java.lang.String dn)
Indicates whether this backend should contain the entry with the specified DN.boolean
isExplicitlyIndexed(java.lang.String attributeType, IndexType indexType)
Indicates whether the backend has been explicitly configured with an index for the specified attribute type and index type.boolean
isIndexed(Filter filter)
Indicates whether the backend may consider a search with the provided filter as indexed.boolean
isIndexed(java.lang.String attributeType, IndexType indexType)
Indicates whether the backend considers filter components involving the specified attribute type and index type indexed.boolean
isLocal()
Indicates whether the backend is considered local (i.e., holds data in a repository that is local to and entirely managed by the server).boolean
isPrivateBackend()
Indicates whether the backend is considered a private backend (with data generated and/or maintained by the server) rather than a public backend (with user data provided and managed by clients).
-
-
-
Method Detail
-
getBackendID
java.lang.String getBackendID()
Retrieves the backend ID for this backend.- Returns:
- The backend ID for this backend.
-
getBaseDNs
java.lang.String[] getBaseDNs()
Retrieves the set of base DNs handled by the backend.- Returns:
- The set of base DNs handled by the backend.
-
getEntryCount
long getEntryCount()
Retrieves the total number of entries contained in this backend, if that information is available.- Returns:
- The total number of entries contained in this backend, or -1 if that information is not available.
-
isLocal
boolean isLocal()
Indicates whether the backend is considered local (i.e., holds data in a repository that is local to and entirely managed by the server).- Returns:
true
if the backend should be considered local, orfalse
if the data may be held in some external repository.
-
isPrivateBackend
boolean isPrivateBackend()
Indicates whether the backend is considered a private backend (with data generated and/or maintained by the server) rather than a public backend (with user data provided and managed by clients).- Returns:
true
if the backend is considered a private backend within the server, orfalse
if it is a public backend.
-
getWritabilityMode
WritabilityMode getWritabilityMode()
Retrieves theWritabilityMode
for the backend.- Returns:
- The
WritabilityMode
for the backend.
-
isIndexed
boolean isIndexed(java.lang.String attributeType, IndexType indexType)
Indicates whether the backend considers filter components involving the specified attribute type and index type indexed. This may include attribute types for which an index has been explicitly configured in the backend, as well as attributes which are automatically considered indexed (e.g., because the backend holds only a small amount of data and considers all attributes indexed).- Parameters:
attributeType
- The name or OID of the attribute type for which to make the determination. It must not benull
.indexType
- TheIndexType
for which to make the determination. It must not benull
.- Returns:
true
if the specified attribute type is indexed for the given type of matching, orfalse
if not.
-
isExplicitlyIndexed
boolean isExplicitlyIndexed(java.lang.String attributeType, IndexType indexType)
Indicates whether the backend has been explicitly configured with an index for the specified attribute type and index type.- Parameters:
attributeType
- The name or OID of the attribute type for which to make the determination. It must not benull
.indexType
- TheIndexType
for which to make the determination. It must not benull
.- Returns:
true
if the specified attribute type is indexed for the given type of matching, orfalse
if not.
-
isIndexed
boolean isIndexed(Filter filter)
Indicates whether the backend may consider a search with the provided filter as indexed.- Parameters:
filter
- TheFilter
for which to make the determination. It must not benull
.- Returns:
true
if a search with the provided filter may be considered indexed in the backend, orfalse
if not.
-
entryExists
boolean entryExists(java.lang.String dn) throws LDAPException
Indicates whether the specified entry exists in the backend.- Parameters:
dn
- The DN for which to make the determination. It must not benull
.- Returns:
true
if the specified entry exists in the backend, orfalse
if not.- Throws:
LDAPException
- If the provided string cannot be parsed as a valid DN or if a problem is encountered while making the determination.
-
getEntry
Entry getEntry(java.lang.String dn) throws LDAPException
Retrieves the specified entry from the backend.- Parameters:
dn
- The DN for which to make the determination. It must not benull
.- Returns:
- The entry with the specified DN, or
null
if the entry does not exist in the backend. - Throws:
LDAPException
- If the provided string cannot be parsed as a valid DN or if a problem is encountered while attempting to retrieve it.
-
handlesEntry
boolean handlesEntry(java.lang.String dn) throws LDAPException
Indicates whether this backend should contain the entry with the specified DN.- Parameters:
dn
- The DN of the entry for which to make the determination.- Returns:
true
if this backend handles operations for the provided entry, orfalse
if it does not.- Throws:
LDAPException
- If the provided string cannot be parsed as a valid DN or if a problem is encountered while making the determination.
-
getParentBackend
BackendContext getParentBackend()
Retrieves information about the parent for the associated backend, if any.- Returns:
- Information about the parent for the associated backend, or
null
if the backend does not have a parent.
-
getSubordinateBackends
BackendContext[] getSubordinateBackends()
Retrieves information about any backends which are immediately subordinate to the associated backend.- Returns:
- Information about any backends which are immediately subordinate to the associated backend, or an empty array if there are no subordinate backends.
-
-