Package com.unboundid.ldap.listener
Class InMemoryDirectoryServerConfig
java.lang.Object
com.unboundid.ldap.listener.InMemoryDirectoryServerConfig
- Direct Known Subclasses:
ReadOnlyInMemoryDirectoryServerConfig
@NotExtensible
@Mutable
@ThreadSafety(level=NOT_THREADSAFE)
public class InMemoryDirectoryServerConfig
extends Object
This class provides a simple data structure with information that may be
used to control the behavior of an
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:
- Listeners: The server will provide a single listener that will use an automatically-selected port on all interfaces, which will not use SSL or StartTLS.
- Allowed Operation Types: All types of operations will be allowed.
- Authentication Required Operation Types: Authentication will not be required for any types of operations.
- Schema: The server will use a schema with a number of standard attribute types and object classes.
- Additional Bind Credentials: The server will not have any additional bind credentials.
- Referential Integrity Attributes: Referential integrity will not be maintained.
- Generate Operational Attributes: The server will automatically generate a number of operational attributes.
- Extended Operation Handlers: The server will support the password modify extended operation as defined in RFC 3062, the start and end transaction extended operations as defined in RFC 5805, and the "Who Am I?" extended operation as defined in RFC 4532.
- SASL Bind Handlers: The server will support the SASL PLAIN mechanism as defined in RFC 4616.
- Max ChangeLog Entries: The server will not provide an LDAP changelog.
- Access Log Handler: The server will not perform any access logging.
- Code Log Handler: The server will not perform any code logging.
- LDAP Debug Log Handler: The server will not perform any LDAP debug logging.
- Listener Exception Handler: The server will not use a listener exception handler.
- Maximum Size Limit: The server will not enforce a maximum search size limit.
- Password Attributes: The server will use userPassword as the only password attribute.
- Password Encoders: The server will not use any password encoders by default, so passwords will remain in clear text.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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(DN... baseDNs) Creates a new in-memory directory server config object with the default settings.InMemoryDirectoryServerConfig(String... baseDNs) Creates a new in-memory directory server config object with the provided set of base DNs. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdditionalBindCredentials(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.voidaddAdditionalBindCredentials(String dn, 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.voidAdds the provided extended operation handler for use by the server for processing certain types of extended operations.voidAdds 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.voidAdds the provided SASL bind handler for use by the server for processing certain types of SASL bind requests.booleanIndicates whether the server should reject attribute values which violate the constraints of the associated syntax.booleanIndicates whether the server should reject entries which do not contain exactly one structural object class.booleanIndicates whether the server should automatically generate operational attributes (including entryDN, entryUUID, creatorsName, createTimestamp, modifiersName, modifyTimestamp, and subschemaSubentry) for entries in the server.Retrieves the log handler that should be used to record access log messages about operations processed by the server, if any.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.Retrieves the set of operation types that will be allowed by the server.Retrieves the set of operation types that will only be allowed for authenticated clients.DN[]Retrieves the set of base DNs that should be used for the directory server.Retrieves the path to a file to be written with generated code that may be used to construct the requests processed by the server.Retrieves a list of custom attributes that should be included in the root DSE that is dynamically generated by the in-memory directory server.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.Retrieves a list of the extended operation handlers that may be used to process extended operations in the server.Retrieves the log handler that should be used to record JSON-formatted access log messages about operations processed by the server, if any.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.Retrieves the list of listener configurations that should be used for the directory server.Retrieves the object that should be used to handle any errors encountered while attempting to interact with a client, if defined.intRetrieves the maximum number of changelog entries that the server should maintain.intRetrieves the maximum number of concurrent connections that the server will allow.intRetrieves the maximum size in bytes for LDAP messages that will be accepted by the server.intRetrieves the maximum number of entries that the server should return in any search operation.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.Retrieves an unmodifiable set containing the names or OIDs of the attributes that may hold passwords.Retrieves the primary password encoder for the in-memory directory server, if any.Retrieves the names of the attributes for which referential integrity should be maintained.Retrieves a predefined entry that should always be returned as the in-memory directory server's root DSE, if defined.Retrieves a list of the SASL bind handlers that may be used to process SASL bind requests in the server.Retrieves the schema that should be used by the server, if defined.Retrieves an unmodifiable map of the secondary password encoders for the in-memory directory server, indexed by prefix.Retrieves the vendor name value to report in the server root DSE.Retrieves the vendor version value to report in the server root DSE.booleanIndicates whether the code log should include sample code for processing the generated requests.voidsetAccessLogHandler(Handler accessLogHandler) Specifies the log handler that should be used to record access log messages about operations processed by the server.voidsetAllowedOperationTypes(OperationType... operationTypes) Specifies the set of operation types that will be allowed by the server.voidsetAllowedOperationTypes(Collection<OperationType> operationTypes) Specifies the set of operation types that will be allowed by the server.voidsetAuthenticationRequiredOperationTypes(OperationType... operationTypes) Specifies the set of operation types that will only be allowed for authenticated clients.voidsetAuthenticationRequiredOperationTypes(Collection<OperationType> operationTypes) Specifies the set of operation types that will only be allowed for authenticated clients.voidsetBaseDNs(DN... baseDNs) Specifies the set of base DNs that should be used for the directory server.voidsetBaseDNs(String... baseDNs) Specifies the set of base DNs that should be used for the directory server.voidsetCodeLogDetails(String codeLogPath, boolean includeProcessing) Specifies information about code logging that should be performed by the server, if any.voidsetCustomRootDSEAttributes(List<Attribute> customRootDSEAttributes) Specifies a list of custom attributes that should be included in the root DSE that is dynamically generated by the in-memory directory server.voidsetEnforceAttributeSyntaxCompliance(boolean enforceAttributeSyntaxCompliance) Specifies whether the server should reject attribute values which violate the constraints of the associated syntax.voidsetEnforceSingleStructuralObjectClass(boolean enforceSingleStructuralObjectClass) Specifies whether the server should reject entries which do not contain exactly one structural object class.voidsetEqualityIndexAttributes(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.voidsetEqualityIndexAttributes(Collection<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.voidsetGenerateOperationalAttributes(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.voidsetJSONAccessLogHandler(Handler jsonAccessLogHandler) Specifies the log handler that should be used to record JSON-formatted access log messages about operations processed by the server.voidsetLDAPDebugLogHandler(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.voidsetListenerConfigs(InMemoryListenerConfig... listenerConfigs) Specifies the configurations for all listeners that should be used for the directory server.voidsetListenerConfigs(Collection<InMemoryListenerConfig> listenerConfigs) Specifies the configurations for all listeners that should be used for the directory server.voidsetListenerExceptionHandler(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.voidsetMaxChangeLogEntries(int maxChangeLogEntries) Specifies the maximum number of changelog entries that the server should maintain.voidsetMaxConnections(int maxConnections) Specifies the maximum number of concurrent connections that the server will allow.voidsetMaxMessageSizeBytes(int maxMessageSizeBytes) Specifies the maximum size in bytes for LDAP messages that will be accepted by the server.voidsetMaxSizeLimit(int maxSizeLimit) Specifies the maximum number of entries that the server should return in any search operation.voidsetPasswordAttributes(String... passwordAttributes) Specifies the names or OIDs of the attributes that may hold passwords.voidsetPasswordAttributes(Collection<String> passwordAttributes) Specifies the names or OIDs of the attributes that may hold passwords.voidsetPasswordEncoders(InMemoryPasswordEncoder primaryEncoder, InMemoryPasswordEncoder... secondaryEncoders) Specifies the set of password encoders to use for the in-memory directory server.voidsetPasswordEncoders(InMemoryPasswordEncoder primaryEncoder, Collection<InMemoryPasswordEncoder> secondaryEncoders) Specifies the set of password encoders to use for the in-memory directory server.voidsetReferentialIntegrityAttributes(String... referentialIntegrityAttributes) Specifies the names of the attributes for which referential integrity should be maintained.voidsetReferentialIntegrityAttributes(Collection<String> referentialIntegrityAttributes) Specifies the names of the attributes for which referential integrity should be maintained.voidsetRootDSEEntry(Entry rootDSEEntry) Specifies an entry that should always be returned as the in-memory directory server's root DSE.voidSpecifies the schema that should be used by the server.voidsetVendorName(String vendorName) Specifies the vendor name value to report in the server root DSE.voidsetVendorVersion(String vendorVersion) Specifies the vendor version value to report in the server root DSE.toString()Retrieves a string representation of this in-memory directory server configuration.voidtoString(StringBuilder buffer) Appends a string representation of this in-memory directory server configuration to the provided buffer.
-
Constructor Details
-
InMemoryDirectoryServerConfig
Creates a new in-memory directory server config object with the provided set of base DNs.- Parameters:
baseDNs- The set of base DNs to use for the server. It must not benullor empty.- Throws:
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.
-
InMemoryDirectoryServerConfig
Creates a new in-memory directory server config object with the default settings.- Parameters:
baseDNs- The set of base DNs to use for the server. It must not benullor empty.- Throws:
LDAPException- If the provided set of base DNs is null or empty.
-
InMemoryDirectoryServerConfig
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.- Parameters:
cfg- The in-memory directory server config object for to be duplicated.
-
-
Method Details
-
getBaseDNs
Retrieves the set of base DNs that should be used for the directory server.- Returns:
- The set of base DNs that should be used for the directory server.
-
setBaseDNs
Specifies the set of base DNs that should be used for the directory server.- Parameters:
baseDNs- The set of base DNs that should be used for the directory server. It must not benullor empty.- Throws:
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.
-
setBaseDNs
Specifies the set of base DNs that should be used for the directory server.- Parameters:
baseDNs- The set of base DNs that should be used for the directory server. It must not benullor empty.- Throws:
LDAPException- If the provided set of base DNs is null or empty.
-
getListenerConfigs
Retrieves the list of listener configurations that should be used for the directory server.- Returns:
- The list of listener configurations that should be used for the directory server.
-
setListenerConfigs
public void setListenerConfigs(@NotNull InMemoryListenerConfig... listenerConfigs) throws LDAPException Specifies the configurations for all listeners that should be used for the directory server.- Parameters:
listenerConfigs- The configurations for all listeners that should be used for the directory server. It must not benullor empty, and it must not contain multiple configurations with the same name.- Throws:
LDAPException- If there is a problem with the provided set of listener configurations.
-
setListenerConfigs
public void setListenerConfigs(@NotNull Collection<InMemoryListenerConfig> listenerConfigs) throws LDAPException Specifies the configurations for all listeners that should be used for the directory server.- Parameters:
listenerConfigs- The configurations for all listeners that should be used for the directory server. It must not benullor empty, and it must not contain multiple configurations with the same name.- Throws:
LDAPException- If there is a problem with the provided set of listener configurations.
-
getAllowedOperationTypes
Retrieves the set of operation types that will be allowed by the server. Note that if the server is configured to support StartTLS, then it will be allowed even if other types of extended operations are not allowed.- Returns:
- The set of operation types that will be allowed by the server.
-
setAllowedOperationTypes
Specifies the set of operation types that will be allowed by the server. Note that if the server is configured to support StartTLS, then it will be allowed even if other types of extended operations are not allowed.- Parameters:
operationTypes- The set of operation types that will be allowed by the server.
-
setAllowedOperationTypes
Specifies the set of operation types that will be allowed by the server. Note that if the server is configured to support StartTLS, then it will be allowed even if other types of extended operations are not allowed.- Parameters:
operationTypes- The set of operation types that will be allowed by the server.
-
getAuthenticationRequiredOperationTypes
Retrieves the set of operation types that will only be allowed for authenticated clients. Note that authentication will never be required for bind operations, and if the server is configured to support StartTLS, then authentication will never be required for StartTLS operations even if it is required for other types of extended operations.- Returns:
- The set of operation types that will only be allowed for authenticated clients.
-
setAuthenticationRequiredOperationTypes
Specifies the set of operation types that will only be allowed for authenticated clients. Note that authentication will never be required for bind operations, and if the server is configured to support StartTLS, then authentication will never be required for StartTLS operations even if it is required for other types of extended operations.- Parameters:
operationTypes- The set of operation types that will be allowed for authenticated clients.
-
setAuthenticationRequiredOperationTypes
public void setAuthenticationRequiredOperationTypes(@Nullable Collection<OperationType> operationTypes) Specifies the set of operation types that will only be allowed for authenticated clients. Note that authentication will never be required for bind operations, and if the server is configured to support StartTLS, then authentication will never be required for StartTLS operations even if it is required for other types of extended operations.- Parameters:
operationTypes- The set of operation types that will be allowed for authenticated clients.
-
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. This can be used to mimic the functionality of special administrative accounts (e.g., "cn=Directory Manager" in many directories). The map that is returned may be altered if desired.- Returns:
- 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.
-
addAdditionalBindCredentials
public void addAdditionalBindCredentials(@NotNull String dn, @NotNull String password) throws LDAPException 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. This can be used to mimic the functionality of special administrative accounts (e.g., "cn=Directory Manager" in many directories). If a password has already been defined for the given DN, then it will be replaced with the newly-supplied password.- Parameters:
dn- The bind DN to allow. It must not benullor represent the null DN.password- The password for the provided bind DN. It must not benullor empty.- Throws:
LDAPException- If there is a problem with the provided bind DN or password.
-
addAdditionalBindCredentials
public void addAdditionalBindCredentials(@NotNull String dn, @NotNull byte[] password) throws LDAPException 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. This can be used to mimic the functionality of special administrative accounts (e.g., "cn=Directory Manager" in many directories). If a password has already been defined for the given DN, then it will be replaced with the newly-supplied password.- Parameters:
dn- The bind DN to allow. It must not benullor represent the null DN.password- The password for the provided bind DN. It must not benullor empty.- Throws:
LDAPException- If there is a problem with the provided bind DN or password.
-
getListenerExceptionHandler
Retrieves the object that should be used to handle any errors encountered while attempting to interact with a client, if defined.- Returns:
- The object that should be used to handle any errors encountered
while attempting to interact with a client, or
nullif no exception handler should be used.
-
setListenerExceptionHandler
Specifies the LDAP listener exception handler that the server should use to handle any errors encountered while attempting to interact with a client.- Parameters:
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 benullif no exception handler should be used.
-
getSchema
Retrieves the schema that should be used by the server, if defined. If a schema is defined, then it will be used to validate entries and determine which matching rules should be used for various types of matching operations.- Returns:
- The schema that should be used by the server, or
nullif no schema should be used.
-
setSchema
Specifies the schema that should be used by the server. If a schema is defined, then it will be used to validate entries and determine which matching rules should be used for various types of matching operations.- Parameters:
schema- The schema that should be used by the server. It may benullif no schema should be used.
-
enforceAttributeSyntaxCompliance
Indicates whether the server should reject attribute values which violate the constraints of the associated syntax. This setting will be ignored if anullschema is in place.- Returns:
trueif the server should reject attribute values which violate the constraints of the associated syntax, orfalseif not.
-
setEnforceAttributeSyntaxCompliance
Specifies whether the server should reject attribute values which violate the constraints of the associated syntax. This setting will be ignored if anullschema is in place.- Parameters:
enforceAttributeSyntaxCompliance- Indicates whether the server should reject attribute values which violate the constraints of the associated syntax.
-
enforceSingleStructuralObjectClass
Indicates whether the server should reject entries which do not contain exactly one structural object class. This setting will be ignored if anullschema is in place.- Returns:
trueif the server should reject entries which do not contain exactly one structural object class, orfalseif it should allow entries which do not have any structural class or that have multiple structural classes.
-
setEnforceSingleStructuralObjectClass
Specifies whether the server should reject entries which do not contain exactly one structural object class. This setting will be ignored if anullschema is in place.- Parameters:
enforceSingleStructuralObjectClass- Indicates whether the server should reject entries which do not contain exactly one structural object class.
-
getAccessLogHandler
Retrieves the log handler that should be used to record access log messages about operations processed by the server, if any.- Returns:
- The log handler that should be used to record access log messages
about operations processed by the server, or
nullif no access logging should be performed.
-
setAccessLogHandler
Specifies the log handler that should be used to record access log messages about operations processed by the server.- Parameters:
accessLogHandler- The log handler that should be used to record access log messages about operations processed by the server. It may benullif no access logging should be performed.
-
getJSONAccessLogHandler
Retrieves the log handler that should be used to record JSON-formatted access log messages about operations processed by the server, if any.- Returns:
- The log handler that should be used to record JSON-formatted
access log messages about operations processed by the server, or
nullif no access logging should be performed.
-
setJSONAccessLogHandler
Specifies the log handler that should be used to record JSON-formatted access log messages about operations processed by the server.- Parameters:
jsonAccessLogHandler- The log handler that should be used to record JSON-formatted access log messages about operations processed by the server. It may benullif no access logging should be performed.
-
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.- Returns:
- The log handler that should be used to record detailed
protocol-level debug messages about LDAP communication to and from
the server, or
nullif no debug logging should be performed.
-
setLDAPDebugLogHandler
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.- Parameters:
ldapDebugLogHandler- The log handler that should be used to record detailed messages about LDAP communication to and from the server. It may benullif no LDAP debug logging should be performed.
-
getCodeLogPath
Retrieves the path to a file to be written with generated code that may be used to construct the requests processed by the server.- Returns:
- The path to a file to be written with generated code that may be
used to construct the requests processed by the server, or
nullif no code log should be written.
-
includeRequestProcessingInCodeLog
Indicates whether the code log should include sample code for processing the generated requests. This will only be used ifgetCodeLogPath()returns a non-nullvalue.- Returns:
falseif the code log should only include code that corresponds to requests received from clients, ortrueif the code log should also include sample code for processing the generated requests and interpreting the results.
-
setCodeLogDetails
Specifies information about code logging that should be performed by the server, if any.- Parameters:
codeLogPath- The path to the file to which a code log should be written. It may benullif no code log should be written.includeProcessing- Indicates whether to include sample code that demonstrates how to process the requests and interpret the results. This will only be used if thecodeLogPathargument is non-null.
-
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. The contents of the list may be altered by the caller.- Returns:
- An updatable list of the operation interceptors that may be used to intercept and transform requests and/or responses.
-
addInMemoryOperationInterceptor
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.- Parameters:
interceptor- The operation interceptor that should be invoked in the course of processing requests and responses.
-
getExtendedOperationHandlers
Retrieves a list of the extended operation handlers that may be used to process extended operations in the server. The contents of the list may be altered by the caller.- Returns:
- An updatable list of the extended operation handlers that may be used to process extended operations in the server.
-
addExtendedOperationHandler
Adds the provided extended operation handler for use by the server for processing certain types of extended operations.- Parameters:
handler- The extended operation handler that should be used by the server for processing certain types of extended operations.
-
getSASLBindHandlers
Retrieves a list of the SASL bind handlers that may be used to process SASL bind requests in the server. The contents of the list may be altered by the caller.- Returns:
- An updatable list of the SASL bind handlers that may be used to process SASL bind requests in the server.
-
addSASLBindHandler
Adds the provided SASL bind handler for use by the server for processing certain types of SASL bind requests.- Parameters:
handler- The SASL bind handler that should be used by the server for processing certain types of SASL bind requests.
-
generateOperationalAttributes
Indicates whether the server should automatically generate operational attributes (including entryDN, entryUUID, creatorsName, createTimestamp, modifiersName, modifyTimestamp, and subschemaSubentry) for entries in the server.- Returns:
trueif the server should automatically generate operational attributes for entries in the server, orfalseif not.
-
setGenerateOperationalAttributes
Specifies whether the server should automatically generate operational attributes (including entryDN, entryUUID, creatorsName, createTimestamp, modifiersName, modifyTimestamp, and subschemaSubentry) for entries in the server.- Parameters:
generateOperationalAttributes- Indicates whether the server should automatically generate operational attributes for entries in the server.
-
getMaxChangeLogEntries
Retrieves the maximum number of changelog entries that the server should maintain.- Returns:
- The maximum number of changelog entries that the server should maintain, or 0 if the server should not maintain a changelog.
-
setMaxChangeLogEntries
Specifies the maximum number of changelog entries that the server should maintain. A value less than or equal to zero indicates that the server should not attempt to maintain a changelog.- Parameters:
maxChangeLogEntries- The maximum number of changelog entries that the server should maintain.
-
getMaxConnections
Retrieves the maximum number of concurrent connections that the server will allow. If a client tries to establish a new connection while the server already has the maximum number of concurrent connections, then the new connection will be rejected. Note that if the server is configured with multiple listeners, then each listener will be allowed to have up to this number of connections.- Returns:
- The maximum number of concurrent connections that the server will allow, or zero if no limit should be enforced.
-
setMaxConnections
Specifies the maximum number of concurrent connections that the server will allow. If a client tries to establish a new connection while the server already has the maximum number of concurrent connections, then the new connection will be rejected. Note that if the server is configured with multiple listeners, then each listener will be allowed to have up to this number of connections.- Parameters:
maxConnections- The maximum number of concurrent connections that the server will allow. A value that is less than or equal to zero indicates no limit.
-
getMaxMessageSizeBytes
Retrieves the maximum size in bytes for LDAP messages that will be accepted by the server.- Returns:
- The maximum size in bytes for LDAP messages that will be accepted by the server.
-
setMaxMessageSizeBytes
Specifies the maximum size in bytes for LDAP messages that will be accepted by the server.- Parameters:
maxMessageSizeBytes- The maximum size in bytes for LDAP messages that will be accepted by the server. A value that is less than or equal to zero will use the maximum allowed message size.
-
getMaxSizeLimit
Retrieves the maximum number of entries that the server should return in any search operation.- Returns:
- The maximum number of entries that the server should return in any search operation, or zero if no limit should be enforced.
-
setMaxSizeLimit
Specifies the maximum number of entries that the server should return in any search operation. A value less than or equal to zero indicates that no maximum limit should be enforced.- Parameters:
maxSizeLimit- The maximum number of entries that the server should return in any search operation.
-
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.- Returns:
- 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, or an empty list if no equality indexes should be created.
-
setEqualityIndexAttributes
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.- Parameters:
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 benullor empty to indicate that no equality indexes should be maintained.
-
setEqualityIndexAttributes
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.- Parameters:
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 benullor empty to indicate that no equality indexes should be maintained.
-
getReferentialIntegrityAttributes
Retrieves the names of the attributes for which referential integrity should be maintained. If referential integrity is to be provided and an entry is removed, then any other entries containing one of the specified attributes with a value equal to the DN of the entry that was removed, then that value will also be removed. Similarly, if an entry is moved or renamed, then any references to that entry in one of the specified attributes will be updated to reflect the new DN.- Returns:
- The names of the attributes for which referential integrity should be maintained, or an empty set if referential integrity should not be maintained for any attributes.
-
setReferentialIntegrityAttributes
Specifies the names of the attributes for which referential integrity should be maintained. If referential integrity is to be provided and an entry is removed, then any other entries containing one of the specified attributes with a value equal to the DN of the entry that was removed, then that value will also be removed. Similarly, if an entry is moved or renamed, then any references to that entry in one of the specified attributes will be updated to reflect the new DN.- Parameters:
referentialIntegrityAttributes- The names of the attributes for which referential integrity should be maintained. The values of these attributes should be DNs. It may benullor empty if referential integrity should not be maintained.
-
setReferentialIntegrityAttributes
public void setReferentialIntegrityAttributes(@Nullable Collection<String> referentialIntegrityAttributes) Specifies the names of the attributes for which referential integrity should be maintained. If referential integrity is to be provided and an entry is removed, then any other entries containing one of the specified attributes with a value equal to the DN of the entry that was removed, then that value will also be removed. Similarly, if an entry is moved or renamed, then any references to that entry in one of the specified attributes will be updated to reflect the new DN.- Parameters:
referentialIntegrityAttributes- The names of the attributes for which referential integrity should be maintained. The values of these attributes should be DNs. It may benullor empty if referential integrity should not be maintained.
-
getVendorName
Retrieves the vendor name value to report in the server root DSE.- Returns:
- The vendor name value to report in the server root DSE, or
nullif no vendor name should appear.
-
setVendorName
Specifies the vendor name value to report in the server root DSE.- Parameters:
vendorName- The vendor name value to report in the server root DSE. It may benullif no vendor name should appear.
-
getVendorVersion
Retrieves the vendor version value to report in the server root DSE.- Returns:
- The vendor version value to report in the server root DSE, or
nullif no vendor version should appear.
-
setVendorVersion
Specifies the vendor version value to report in the server root DSE.- Parameters:
vendorVersion- The vendor version value to report in the server root DSE. It may benullif no vendor version should appear.
-
getRootDSEEntry
Retrieves a predefined entry that should always be returned as the in-memory directory server's root DSE, if defined.- Returns:
- A predefined entry that should always be returned as the in-memory
directory server's root DSE, or
nullif the root DSE should be dynamically generated.
-
setRootDSEEntry
Specifies an entry that should always be returned as the in-memory directory server's root DSE. Note that if a specific root DSE entry is provided, then the generated root DSE will not necessarily accurately reflect the capabilities of the server, nor will it be dynamically updated as operations are processed. As an alternative, thesetCustomRootDSEAttributes(java.util.List<com.unboundid.ldap.sdk.Attribute>)method may be used to specify custom attributes that should be included in the root DSE entry while still having the server generate dynamic values for other attributes. If both a root DSE entry and a custom set of root DSE attributes are specified, then the root DSE entry will take precedence.- Parameters:
rootDSEEntry- An entry that should always be returned as the in-memory directory server's root DSE, ornullto indicate that the root DSE should be dynamically generated.
-
getCustomRootDSEAttributes
Retrieves a list of custom attributes that should be included in the root DSE that is dynamically generated by the in-memory directory server.- Returns:
- A list of custom attributes that will be included in the root DSE that is generated by the in-memory directory server, or an empty list if none should be included.
-
setCustomRootDSEAttributes
Specifies a list of custom attributes that should be included in the root DSE that is dynamically generated by the in-memory directory server. Note that this list of attributes will not be used if thesetRootDSEEntry(com.unboundid.ldap.sdk.Entry)method is used to override the entire entry. Also note that any attributes provided in this list will override those that would be dynamically generated by the in-memory directory server.- Parameters:
customRootDSEAttributes- A list of custom attributes that should be included in the root DSE that is dynamically generated by the in-memory directory server. It may benullor empty if no custom attributes should be included in the root DSE.
-
getPasswordAttributes
Retrieves an unmodifiable set containing the names or OIDs of the attributes that may hold passwords. These are the attributes whose values will be used in bind processing, and clear-text values stored in these attributes may be encoded using anInMemoryPasswordEncoder.- Returns:
- An unmodifiable set containing the names or OIDs of the attributes that may hold passwords, or an empty set if no password attributes have been defined.
-
setPasswordAttributes
Specifies the names or OIDs of the attributes that may hold passwords. These are the attributes whose values will be used in bind processing, and clear-text values stored in these attributes may be encoded using anInMemoryPasswordEncoder.- Parameters:
passwordAttributes- The names or OIDs of the attributes that may hold passwords. It may benullor empty if there should not be any password attributes, but that will prevent user authentication from succeeding.
-
setPasswordAttributes
Specifies the names or OIDs of the attributes that may hold passwords. These are the attributes whose values will be used in bind processing, and clear-text values stored in these attributes may be encoded using anInMemoryPasswordEncoder.- Parameters:
passwordAttributes- The names or OIDs of the attributes that may hold passwords. It may benullor empty if there should not be any password attributes, but that will prevent user authentication from succeeding.
-
getPrimaryPasswordEncoder
Retrieves the primary password encoder for the in-memory directory server, if any. The primary password encoder will be used to encode the values of any clear-text passwords provided in add or modify operations and in LDIF imports, and will also be used during authentication processing for any encoded passwords that start with the same prefix as this password encoder.- Returns:
- The primary password encoder for the in-memory directory server,
or
nullif clear-text passwords should be left in the clear without any encoding.
-
getSecondaryPasswordEncoders
Retrieves an unmodifiable map of the secondary password encoders for the in-memory directory server, indexed by prefix. The secondary password encoders will be used to interact with pre-encoded passwords, but will not be used to encode new clear-text passwords.- Returns:
- An unmodifiable map of the secondary password encoders for the in-memory directory server, or an empty map if no secondary encoders are defined.
-
setPasswordEncoders
public void setPasswordEncoders(@Nullable InMemoryPasswordEncoder primaryEncoder, @Nullable InMemoryPasswordEncoder... secondaryEncoders) throws LDAPException Specifies the set of password encoders to use for the in-memory directory server. There must not be any conflicts between the prefixes used for any of the password encoders (that is, none of the secondary password encoders may use the same prefix as the primary password encoder or the same prefix as any other secondary password encoder).
Either or both the primary and secondary encoders may be left undefined. If both primary and secondary encoders are left undefined, then the server will assume that all passwords are in the clear. If only a primary encoder is configured without any secondary encoders, then the server will encode all new passwords that don't start with its prefix. If only secondary encoders are configured without a primary encoder, then all new passwords will be left in the clear, but any existing pre-encoded passwords using those mechanisms will be handled properly.- Parameters:
primaryEncoder- The primary password encoder to use for the in-memory directory server. This encoder will be used to encode any new clear-text passwords that are provided to the server in add or modify operations or in LDIF imports. It will also be used to interact with pre-encoded passwords for any encoded passwords that start with the same prefix as this password encoder. It may benullif no password encoder is desired and clear-text passwords should remain in the clear.secondaryEncoders- The secondary password encoders to use when interacting with pre-encoded passwords, but that will not be used to encode new clear-text passwords. This may benullor empty if no secondary password encoders are needed.- Throws:
LDAPException- If there is a conflict between the prefixes used by two or more of the provided encoders.
-
setPasswordEncoders
public void setPasswordEncoders(@Nullable InMemoryPasswordEncoder primaryEncoder, @Nullable Collection<InMemoryPasswordEncoder> secondaryEncoders) throws LDAPException Specifies the set of password encoders to use for the in-memory directory server. There must not be any conflicts between the prefixes used for any of the password encoders (that is, none of the secondary password encoders may use the same prefix as the primary password encoder or the same prefix as any other secondary password encoder).
Either or both the primary and secondary encoders may be left undefined. If both primary and secondary encoders are left undefined, then the server will assume that all passwords are in the clear. If only a primary encoder is configured without any secondary encoders, then the server will encode all new passwords that don't start with its prefix. If only secondary encoders are configured without a primary encoder, then all new passwords will be left in the clear, but any existing pre-encoded passwords using those mechanisms will be handled properly.- Parameters:
primaryEncoder- The primary password encoder to use for the in-memory directory server. This encoder will be used to encode any new clear-text passwords that are provided to the server in add or modify operations or in LDIF imports. It will also be used to interact with pre-encoded passwords for any encoded passwords that start with the same prefix as this password encoder. It may benullif no password encoder is desired and clear-text passwords should remain in the clear.secondaryEncoders- The secondary password encoders to use when interacting with pre-encoded passwords, but that will not be used to encode new clear-text passwords. This may benullor empty if no secondary password encoders are needed.- Throws:
LDAPException- If there is a conflict between the prefixes used by two or more of the provided encoders.
-
toString
Retrieves a string representation of this in-memory directory server configuration. -
toString
Appends a string representation of this in-memory directory server configuration to the provided buffer.- Parameters:
buffer- The buffer to which the string representation should be appended.
-