@NotExtensible @Mutable @ThreadSafety(level=NOT_THREADSAFE) public class InMemoryDirectoryServerConfig extends java.lang.Object
InMemoryDirectoryServer
instance.
At least one base DN must be specified. For all other properties, the
following default values will be used unless an alternate configuration is
provided:
Constructor and Description |
---|
InMemoryDirectoryServerConfig(DN... baseDNs)
Creates a new in-memory directory server config object with the default
settings.
|
InMemoryDirectoryServerConfig(InMemoryDirectoryServerConfig cfg)
Creates a new in-memory directory server config object that is a duplicate
of the provided config and may be altered without impacting the state of
the given config object.
|
InMemoryDirectoryServerConfig(java.lang.String... baseDNs)
Creates a new in-memory directory server config object with the provided
set of base DNs.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalBindCredentials(java.lang.String dn,
byte[] password)
Adds an additional bind DN and password combination that can be used to
bind to the server, even if the corresponding entry does not exist in the
data set.
|
void |
addAdditionalBindCredentials(java.lang.String dn,
java.lang.String password)
Adds an additional bind DN and password combination that can be used to
bind to the server, even if the corresponding entry does not exist in the
data set.
|
void |
addExtendedOperationHandler(InMemoryExtendedOperationHandler handler)
Adds the provided extended operation handler for use by the server for
processing certain types of extended operations.
|
void |
addInMemoryOperationInterceptor(InMemoryOperationInterceptor interceptor)
Adds the provided operation interceptor to the list of operation
interceptors that may be used to transform requests before they are
processed by the in-memory directory server, and/or to transform responses
before they are returned to the client.
|
void |
addSASLBindHandler(InMemorySASLBindHandler handler)
Adds the provided SASL bind handler for use by the server for processing
certain types of SASL bind requests.
|
boolean |
enforceAttributeSyntaxCompliance()
Indicates whether the server should reject attribute values which violate
the constraints of the associated syntax.
|
boolean |
enforceSingleStructuralObjectClass()
Indicates whether the server should reject entries which do not contain
exactly one structural object class.
|
boolean |
generateOperationalAttributes()
Indicates whether the server should automatically generate operational
attributes (including entryDN, entryUUID, creatorsName, createTimestamp,
modifiersName, modifyTimestamp, and subschemaSubentry) for entries in the
server.
|
java.util.logging.Handler |
getAccessLogHandler()
Retrieves the log handler that should be used to record access log messages
about operations processed by the server, if any.
|
java.util.Map<DN,byte[]> |
getAdditionalBindCredentials()
Retrieves a map containing DNs and passwords of additional users that will
be allowed to bind to the server, even if their entries do not exist in the
data set.
|
java.util.Set<OperationType> |
getAllowedOperationTypes()
Retrieves the set of operation types that will be allowed by the server.
|
java.util.Set<OperationType> |
getAuthenticationRequiredOperationTypes()
Retrieves the set of operation types that will only be allowed for
authenticated clients.
|
DN[] |
getBaseDNs()
Retrieves the set of base DNs that should be used for the directory server.
|
java.util.List<java.lang.String> |
getEqualityIndexAttributes()
Retrieves a list containing the names or OIDs of the attribute types for
which to maintain an equality index to improve the performance of certain
kinds of searches.
|
java.util.List<InMemoryExtendedOperationHandler> |
getExtendedOperationHandlers()
Retrieves a list of the extended operation handlers that may be used to
process extended operations in the server.
|
java.util.logging.Handler |
getLDAPDebugLogHandler()
Retrieves the log handler that should be used to record detailed messages
about LDAP communication to and from the server, which may be useful for
debugging purposes.
|
java.util.List<InMemoryListenerConfig> |
getListenerConfigs()
Retrieves the list of listener configurations that should be used for the
directory server.
|
LDAPListenerExceptionHandler |
getListenerExceptionHandler()
Retrieves the object that should be used to handle any errors encountered
while attempting to interact with a client, if defined.
|
int |
getMaxChangeLogEntries()
Retrieves the maximum number of changelog entries that the server should
maintain.
|
int |
getMaxSizeLimit()
Retrieves the maximum number of entries that the server should return in
any search operation.
|
java.util.List<InMemoryOperationInterceptor> |
getOperationInterceptors()
Retrieves a list of the operation interceptors that may be used to
intercept and transform requests before they are processed by the in-memory
directory server, and/or to intercept and transform responses before they
are returned to the client.
|
java.util.Set<java.lang.String> |
getReferentialIntegrityAttributes()
Retrieves the names of the attributes for which referential integrity
should be maintained.
|
java.util.List<InMemorySASLBindHandler> |
getSASLBindHandlers()
Retrieves a list of the SASL bind handlers that may be used to process
SASL bind requests in the server.
|
Schema |
getSchema()
Retrieves the schema that should be used by the server, if defined.
|
java.lang.String |
getVendorName()
Retrieves the vendor name value to report in the server root DSE.
|
java.lang.String |
getVendorVersion()
Retrieves the vendor version value to report in the server root DSE.
|
void |
setAccessLogHandler(java.util.logging.Handler accessLogHandler)
Specifies the log handler that should be used to record access log messages
about operations processed by the server.
|
void |
setAllowedOperationTypes(java.util.Collection<OperationType> operationTypes)
Specifies the set of operation types that will be allowed by the server.
|
void |
setAllowedOperationTypes(OperationType... operationTypes)
Specifies the set of operation types that will be allowed by the server.
|
void |
setAuthenticationRequiredOperationTypes(java.util.Collection<OperationType> operationTypes)
Specifies the set of operation types that will only be allowed for
authenticated clients.
|
void |
setAuthenticationRequiredOperationTypes(OperationType... operationTypes)
Specifies the set of operation types that will only be allowed for
authenticated clients.
|
void |
setBaseDNs(DN... baseDNs)
Specifies the set of base DNs that should be used for the directory server.
|
void |
setBaseDNs(java.lang.String... baseDNs)
Specifies the set of base DNs that should be used for the directory server.
|
void |
setEnforceAttributeSyntaxCompliance(boolean enforceAttributeSyntaxCompliance)
Specifies whether the server should reject attribute values which violate
the constraints of the associated syntax.
|
void |
setEnforceSingleStructuralObjectClass(boolean enforceSingleStructuralObjectClass)
Specifies whether the server should reject entries which do not contain
exactly one structural object class.
|
void |
setEqualityIndexAttributes(java.util.Collection<java.lang.String> equalityIndexAttributes)
Specifies the names or OIDs of the attribute types for which to maintain an
equality index to improve the performance of certain kinds of searches.
|
void |
setEqualityIndexAttributes(java.lang.String... equalityIndexAttributes)
Specifies the names or OIDs of the attribute types for which to maintain an
equality index to improve the performance of certain kinds of searches.
|
void |
setGenerateOperationalAttributes(boolean generateOperationalAttributes)
Specifies whether the server should automatically generate operational
attributes (including entryDN, entryUUID, creatorsName, createTimestamp,
modifiersName, modifyTimestamp, and subschemaSubentry) for entries in the
server.
|
void |
setLDAPDebugLogHandler(java.util.logging.Handler ldapDebugLogHandler)
Specifies the log handler that should be used to record detailed messages
about LDAP communication to and from the server, which may be useful for
debugging purposes.
|
void |
setListenerConfigs(java.util.Collection<InMemoryListenerConfig> listenerConfigs)
Specifies the configurations for all listeners that should be used for the
directory server.
|
void |
setListenerConfigs(InMemoryListenerConfig... listenerConfigs)
Specifies the configurations for all listeners that should be used for the
directory server.
|
void |
setListenerExceptionHandler(LDAPListenerExceptionHandler exceptionHandler)
Specifies the LDAP listener exception handler that the server should use to
handle any errors encountered while attempting to interact with a client.
|
void |
setMaxChangeLogEntries(int maxChangeLogEntries)
Specifies the maximum number of changelog entries that the server should
maintain.
|
void |
setMaxSizeLimit(int maxSizeLimit)
Specifies the maximum number of entries that the server should return in
any search operation.
|
void |
setReferentialIntegrityAttributes(java.util.Collection<java.lang.String> referentialIntegrityAttributes)
Specifies the names of the attributes for which referential integrity
should be maintained.
|
void |
setReferentialIntegrityAttributes(java.lang.String... referentialIntegrityAttributes)
Specifies the names of the attributes for which referential integrity
should be maintained.
|
void |
setSchema(Schema schema)
Specifies the schema that should be used by the server.
|
void |
setVendorName(java.lang.String vendorName)
Specifies the vendor name value to report in the server root DSE.
|
void |
setVendorVersion(java.lang.String vendorVersion)
Specifies the vendor version value to report in the server root DSE.
|
java.lang.String |
toString()
Retrieves a string representation of this in-memory directory server
configuration.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this in-memory directory server
configuration to the provided buffer.
|
public InMemoryDirectoryServerConfig(java.lang.String... baseDNs) throws LDAPException
baseDNs
- The set of base DNs to use for the server. It must not
be null
or empty.LDAPException
- If the provided set of base DN strings is null or
empty, or if any of the provided base DN strings
cannot be parsed as a valid DN.public InMemoryDirectoryServerConfig(DN... baseDNs) throws LDAPException
baseDNs
- The set of base DNs to use for the server. It must not
be null
or empty.LDAPException
- If the provided set of base DNs is null or empty.public InMemoryDirectoryServerConfig(InMemoryDirectoryServerConfig cfg)
cfg
- The in-memory directory server config object for to be
duplicated.public DN[] getBaseDNs()
public void setBaseDNs(java.lang.String... baseDNs) throws LDAPException
baseDNs
- The set of base DNs that should be used for the directory
server. It must not be null
or empty.LDAPException
- If the provided set of base DN strings is null or
empty, or if any of the provided base DN strings
cannot be parsed as a valid DN.public void setBaseDNs(DN... baseDNs) throws LDAPException
baseDNs
- The set of base DNs that should be used for the directory
server. It must not be null
or empty.LDAPException
- If the provided set of base DNs is null or empty.public java.util.List<InMemoryListenerConfig> getListenerConfigs()
public void setListenerConfigs(InMemoryListenerConfig... listenerConfigs) throws LDAPException
listenerConfigs
- The configurations for all listeners that should
be used for the directory server. It must not be
null
or empty, and it must not contain
multiple configurations with the same name.LDAPException
- If there is a problem with the provided set of
listener configurations.public void setListenerConfigs(java.util.Collection<InMemoryListenerConfig> listenerConfigs) throws LDAPException
listenerConfigs
- The configurations for all listeners that should
be used for the directory server. It must not be
null
or empty, and it must not contain
multiple configurations with the same name.LDAPException
- If there is a problem with the provided set of
listener configurations.public java.util.Set<OperationType> getAllowedOperationTypes()
public void setAllowedOperationTypes(OperationType... operationTypes)
operationTypes
- The set of operation types that will be allowed by
the server.public void setAllowedOperationTypes(java.util.Collection<OperationType> operationTypes)
operationTypes
- The set of operation types that will be allowed by
the server.public java.util.Set<OperationType> getAuthenticationRequiredOperationTypes()
public void setAuthenticationRequiredOperationTypes(OperationType... operationTypes)
operationTypes
- The set of operation types that will be allowed for
authenticated clients.public void setAuthenticationRequiredOperationTypes(java.util.Collection<OperationType> operationTypes)
operationTypes
- The set of operation types that will be allowed for
authenticated clients.public java.util.Map<DN,byte[]> getAdditionalBindCredentials()
public void addAdditionalBindCredentials(java.lang.String dn, java.lang.String password) throws LDAPException
dn
- The bind DN to allow. It must not be null
or
represent the null DN.password
- The password for the provided bind DN. It must not be
null
or empty.LDAPException
- If there is a problem with the provided bind DN or
password.public void addAdditionalBindCredentials(java.lang.String dn, byte[] password) throws LDAPException
dn
- The bind DN to allow. It must not be null
or
represent the null DN.password
- The password for the provided bind DN. It must not be
null
or empty.LDAPException
- If there is a problem with the provided bind DN or
password.public LDAPListenerExceptionHandler getListenerExceptionHandler()
null
if no
exception handler should be used.public void setListenerExceptionHandler(LDAPListenerExceptionHandler exceptionHandler)
exceptionHandler
- The LDAP listener exception handler that the
server should use to handle any errors
encountered while attempting to interact with a
client. It may be null
if no exception
handler should be used.public Schema getSchema()
null
if
no schema should be used.public void setSchema(Schema schema)
schema
- The schema that should be used by the server. It may be
null
if no schema should be used.public boolean enforceAttributeSyntaxCompliance()
null
schema is in place.true
if the server should reject attribute values which
violate the constraints of the associated syntax, or false
if not.public void setEnforceAttributeSyntaxCompliance(boolean enforceAttributeSyntaxCompliance)
null
schema is in place.enforceAttributeSyntaxCompliance
- Indicates whether the server
should reject attribute values
which violate the constraints of
the associated syntax.public boolean enforceSingleStructuralObjectClass()
null
schema is in place.true
if the server should reject entries which do not
contain exactly one structural object class, or false
if
it should allow entries which do not have any structural class or
that have multiple structural classes.public void setEnforceSingleStructuralObjectClass(boolean enforceSingleStructuralObjectClass)
null
schema is in place.enforceSingleStructuralObjectClass
- Indicates whether the server
should reject entries which do
not contain exactly one
structural object class.public java.util.logging.Handler getAccessLogHandler()
null
if no
access logging should be performed.public void setAccessLogHandler(java.util.logging.Handler accessLogHandler)
accessLogHandler
- The log handler that should be used to record
access log messages about operations processed by
the server. It may be null
if no access
logging should be performed.public java.util.logging.Handler getLDAPDebugLogHandler()
null
if no debug logging should be
performed.public void setLDAPDebugLogHandler(java.util.logging.Handler ldapDebugLogHandler)
ldapDebugLogHandler
- The log handler that should be used to record
detailed messages about LDAP communication to
and from the server. It may be null
if no LDAP debug logging should be performed.public java.util.List<InMemoryOperationInterceptor> getOperationInterceptors()
public void addInMemoryOperationInterceptor(InMemoryOperationInterceptor interceptor)
interceptor
- The operation interceptor that should be invoked in
the course of processing requests and responses.public java.util.List<InMemoryExtendedOperationHandler> getExtendedOperationHandlers()
public void addExtendedOperationHandler(InMemoryExtendedOperationHandler handler)
handler
- The extended operation handler that should be used by the
server for processing certain types of extended
operations.public java.util.List<InMemorySASLBindHandler> getSASLBindHandlers()
public void addSASLBindHandler(InMemorySASLBindHandler handler)
handler
- The SASL bind handler that should be used by the server
for processing certain types of SASL bind requests.public boolean generateOperationalAttributes()
true
if the server should automatically generate
operational attributes for entries in the server, or false
if not.public void setGenerateOperationalAttributes(boolean generateOperationalAttributes)
generateOperationalAttributes
- Indicates whether the server should
automatically generate operational
attributes for entries in the
server.public int getMaxChangeLogEntries()
public void setMaxChangeLogEntries(int maxChangeLogEntries)
maxChangeLogEntries
- The maximum number of changelog entries that
the server should maintain.public int getMaxSizeLimit()
public void setMaxSizeLimit(int maxSizeLimit)
maxSizeLimit
- The maximum number of entries that the server should
return in any search operation.public java.util.List<java.lang.String> getEqualityIndexAttributes()
public void setEqualityIndexAttributes(java.lang.String... equalityIndexAttributes)
equalityIndexAttributes
- The names or OIDs of the attributes for
which to maintain an equality index to
improve the performance of certain kinds
of searches. It may be null
or
empty to indicate that no equality indexes
should be maintained.public void setEqualityIndexAttributes(java.util.Collection<java.lang.String> equalityIndexAttributes)
equalityIndexAttributes
- The names or OIDs of the attributes for
which to maintain an equality index to
improve the performance of certain kinds
of searches. It may be null
or
empty to indicate that no equality indexes
should be maintained.public java.util.Set<java.lang.String> getReferentialIntegrityAttributes()
public void setReferentialIntegrityAttributes(java.lang.String... referentialIntegrityAttributes)
referentialIntegrityAttributes
- The names of the attributes for
which referential integrity should
be maintained. The values of
these attributes should be DNs.
It may be null
or empty if
referential integrity should not
be maintained.public void setReferentialIntegrityAttributes(java.util.Collection<java.lang.String> referentialIntegrityAttributes)
referentialIntegrityAttributes
- The names of the attributes for
which referential integrity should
be maintained. The values of
these attributes should be DNs.
It may be null
or empty if
referential integrity should not
be maintained.public java.lang.String getVendorName()
null
if no vendor name should appear.public void setVendorName(java.lang.String vendorName)
vendorName
- The vendor name value to report in the server root DSE.
It may be null
if no vendor name should appear.public java.lang.String getVendorVersion()
null
if no vendor version should appear.public void setVendorVersion(java.lang.String vendorVersion)
vendorVersion
- The vendor version value to report in the server
root DSE. It may be null
if no vendor
version should appear.public java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuilder buffer)
buffer
- The buffer to which the string representation should be
appended.