@NotExtensible @ThreadSafety(level=INTERFACE_THREADSAFE) public interface ServerContext
Modifier and Type | Method and Description |
---|---|
EMailAttachment |
createEMailAttachment(java.lang.String filename,
java.lang.String contentType,
boolean isInline,
byte[] data)
Creates an email attachment with the provided information.
|
EMailMessage |
createEMailMessage(java.lang.String senderAddress,
java.lang.String replyToAddress,
java.util.Collection<java.lang.String> toAddresses,
java.util.Collection<java.lang.String> ccAddresses,
java.util.Collection<java.lang.String> bccAddresses,
java.lang.String subject,
java.lang.String plainTextPart,
java.lang.String htmlPart,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> customHeaders,
java.util.List<EMailAttachment> attachments)
Creates a multi-part email message with the provided information.
|
java.lang.Thread |
createThread(ServerThread serverThread,
java.lang.String name)
Creates a new thread to run within the server.
|
ValueConstructor |
createValueConstructor(java.lang.String constructedValueTemplate)
Returns a ValueConstructor built from the provided value template.
|
void |
debugCaught(java.lang.Throwable t)
Writes a debug message indicating that the provided exception has been
caught.
|
boolean |
debugEnabled()
Indicates whether debugging is enabled in the server.
|
void |
debugError(java.lang.String message)
Writes a debug message with an error severity.
|
void |
debugInfo(java.lang.String message)
Writes a debug message with an informational severity.
|
void |
debugThrown(java.lang.Throwable t)
Writes a debug message indicating that the provided exception will be
thrown.
|
void |
debugVerbose(java.lang.String message)
Writes a debug message with a verbose severity.
|
void |
debugWarning(java.lang.String message)
Writes a debug message with a warning severity.
|
void |
deregisterAllMonitorProviders()
Deregisters all the monitor providers that were registered with the server
by this instance of
ServerContext . |
void |
deregisterChangeListener(RegisteredChangeListener listener)
Deregisters the provided change listener with the server.
|
void |
deregisterDiskSpaceConsumer(RegisteredDiskSpaceConsumer consumer)
Deregisters the provided disk space consumer with the server.
|
void |
deregisterMonitorProvider(RegisteredMonitorProvider provider)
Deregisters the given monitor provider with the server.
|
void |
deregisterShutdownListener(RegisteredServerShutdownListener listener)
Deregisters the provided server shutdown listener with the server.
|
void |
deregisterSupportedControlOID(java.lang.String oid)
Deregisters the provided OID with the server so that it will no longer
appear in the supportedControl attribute of the server's root DSE.
|
java.lang.String |
getBasicProductName()
Retrieves the base name of the server which is generally the full
product name without the vendor information.
|
LDAPInterface |
getClientConnection(java.lang.String dn,
boolean isClientSecure)
Retrieves a client connection that is authenticated as the specified
user.
|
LDAPInterface |
getClientRootConnection(boolean isClientSecure)
Retrieves a client connection that is authenticated as a root user
and is not subject to access control.
|
java.lang.String |
getCompactProductName()
Retrieves the compact name of the server.
|
java.io.OutputStream |
getEncryptedOutputStream(java.io.OutputStream outputStream,
boolean compress)
Wraps the provided output stream in a
PassphraseEncryptedOutputStream so that data written to it will be
encrypted, optionally after also wrapping it in a GZIPOutputStream
to ensure that the data is compressed before it is encrypted. |
java.io.OutputStream |
getEncryptedOutputStream(java.io.OutputStream outputStream,
java.lang.String encryptionSettingsDefinitionID,
boolean compress)
Wraps the provided output stream in a
PassphraseEncryptedOutputStream so that data written to it will be
encrypted, optionally after also wrapping it in a GZIPOutputStream
to ensure that the data is compressed before it is encrypted. |
EncryptionSettingsDefinition |
getEncryptionSettingsDefinition(java.lang.String id)
Retrieves the encryption settings definition with the specified ID.
|
java.util.List<EncryptionSettingsDefinition> |
getEncryptionSettingsDefinitions()
Retrieves a list of all of the encryption settings definitions contained
in the server's encryption settings database.
|
java.lang.String |
getFullProductName()
Retrieves the full name of the server.
|
java.lang.String |
getFullVendorName()
Retrieves the full name of the server vendor.
|
java.lang.String |
getFullVersion()
Retrieves a string that is the concatenation of the product name, the
major, minor, point, and patch version numbers of the server and any
any other unique version information.
|
Group |
getGroup(java.lang.String groupDN)
Retrieves the group defined in the specified entry.
|
java.util.Map<DN,Group> |
getGroupsForUser(java.lang.String userDN,
boolean directMembershipOnly)
Retrieves the set of groups in which the specified user is a member,
indexed by group DN.
|
java.lang.String |
getInstanceName()
Retrieves the instance name that has been assigned to the server.
|
InternalConnection |
getInternalConnection(java.lang.String dn)
Retrieves an internal connection that is authenticated as the specified
user.
|
InternalConnection |
getInternalRootConnection()
Retrieves an internal connection that is authenticated as a root user
that is not subject to access control.
|
LDAPConnection |
getLDAPExternalServerConnection(java.lang.String ldapExternalServerCfgObjectName,
LDAPConnectionOptions connectionOptions)
Retrieves a connection that is established and (if appropriate)
authenticated to the specified LDAP External server.
|
LDAPConnectionPool |
getLDAPExternalServerConnectionPool(java.lang.String ldapExternalServerCfgObjectName,
LDAPConnectionOptions connectionOptions,
int initialConnections,
int maxConnections,
boolean throwOnConnectFailure)
Retrieves a connection pool with connections to the specified server.
|
Location |
getLocation()
Retrieves the location that has been assigned to the server, if any.
|
int |
getMajorVersionNumber()
Retrieves the major version number for the server.
|
int |
getMinorVersionNumber()
Retrieves the minor version number for the server.
|
java.lang.String |
getObscuredValue(java.lang.String obscuredValueConfigObjectName)
Retrieves the plaintext representation of the specified obscured value from
the server configuration.
|
java.lang.String |
getPackageName()
Retrieves the package name of the server that is used for defining the
server package ZIP file and root directory.
|
char[] |
getPassphraseFromPassphraseProvider(java.lang.String providerName,
boolean allowCached)
Retrieves a passphrase obtained by the specified passphrase provider.
|
int |
getPatchVersionNumber()
Retrieves the patch version number for the server.
|
int |
getPointVersionNumber()
Retrieves the point version number for the server.
|
java.io.InputStream |
getPossiblyCompressedAndEncryptedInputStream(java.io.File file)
Opens an input stream that may be used to read data from the provided
file.
|
java.io.InputStream |
getPossiblyCompressedAndEncryptedInputStream(java.io.InputStream inputStream)
Examines the provided input stream and determines whether its contents have
been encrypted with a
PassphraseEncryptedOutputStream , and if so,
retrieves an input stream that may be used to read its decrypted content. |
EncryptionSettingsDefinition |
getPreferredEncryptionSettingsDefinition()
Retrieves information about the server's preferred encryption settings
definition, which is the default definition that will be used for new
encryption operations if no other definition is requested.
|
java.util.Set<java.lang.String> |
getPrivilegeNames(java.lang.String userDN)
Retrieves the names of the privileges held by the specified user.
|
Schema |
getSchema()
Retrieves a reference to the server schema.
|
java.io.File |
getServerRoot()
Retrieves the path to the server root directory.
|
java.lang.String |
getShortVendorName()
Retrieves the compact name of the server vendor.
|
java.lang.String |
getSourceRevision()
Retrieves a value which identifies the source revision (in the
version control system used to hold the server source code) from which the
server was built.
|
long |
getStartTime()
Retrieves the time that the server was started.
|
java.lang.String |
getStartupID()
Retrieves a compact ID that was generated at the time the server was
started.
|
java.util.UUID |
getStartupUUID()
Retrieves a unique identifier that was generated at the time the server was
started.
|
ToolExecutor |
getToolExecutor()
Retrieves a ToolExecutor that can be used to internally execute select
command line utilities.
|
java.lang.String |
getVersionNumber()
Retrieves a string that is the concatenation of the major, minor,
point, and patch version numbers of the server.
|
java.lang.String |
getVersionQualifier()
Retrieves the version qualifier string for the server.
|
boolean |
hasPrivilege(java.lang.String userDN,
java.lang.String privilegeName)
Indicates whether the specified user has the indicated privilege.
|
boolean |
isDirectoryFunctionalityAvailable()
Indicates whether the extension is running in a server that has Directory
Server functionality available.
|
boolean |
isDirectoryProxyFunctionalityAvailable()
Indicates whether the extension is running in a server that has Directory
Proxy Server functionality available.
|
boolean |
isRunning()
Indicates whether the server is currently running.
|
boolean |
isShuttingDown()
Indicates whether the server is in the process of shutting down.
|
boolean |
isStarting()
Indicates whether the server is in the process of starting up.
|
boolean |
isSyncFunctionalityAvailable()
Indicates whether the extension is running in a server that has
Data Sync Server functionality available.
|
boolean |
isTraceMessageLoggable(LogSeverity logSeverity)
Indicates whether trace log messages of the provided severity can be
logged by an extension to any trace log publishers.
|
void |
logMessage(LogSeverity severity,
java.lang.String message)
Writes a message to the server error log.
|
void |
logTraceMessage(LogSeverity logSeverity,
java.lang.String message)
Writes a message to the server trace log publishers.
|
void |
logTraceMessage(LogSeverity logSeverity,
java.lang.String message,
java.util.Map<java.lang.String,java.lang.String> keyValues)
Writes a message to the server trace log publishers.
|
RegisteredChangeListener |
registerChangeListener(ChangeListener listener,
java.util.Set<ChangeType> changeTypes,
java.util.List<java.lang.String> baseDNs,
Filter filter)
Registers the provided change listener with the server so that it may be
notified of any changes matching the provided criteria.
|
RegisteredDiskSpaceConsumer |
registerDiskSpaceConsumer(DiskSpaceConsumer consumer)
Registers the provided disk space consumer with the server.
|
RegisteredMonitorProvider |
registerMonitorProvider(MonitorProvider provider,
GenericConfig config)
Registers the given monitor provider with the server.
|
RegisteredServerShutdownListener |
registerShutdownListener(ServerShutdownListener listener)
Registers the provided listener to be notified when the server shutdown
process has begun.
|
void |
registerSupportedControlOID(java.lang.String oid)
Registers the provided OID with the server so that it will appear in the
supportedControl attribute of the server's root DSE.
|
void |
reloadHTTPConnectionHandlerCertificates()
Reload the key and trust manager providers associated with any HTTP
connection handlers.that provide support for HTTPS.
|
void |
sendAlert(AlertSeverity severity,
java.lang.String message)
Generates an administrative alert notification.
|
void |
sendAlert(java.lang.String alertTypeName,
AlertSeverity severity,
java.lang.String alertTypeOID,
java.lang.String message)
Generates an administrative alert notification.
|
DegradedAlertType |
sendDegradedAlertNotification(java.lang.String alertTypeName,
AlertSeverity severity,
java.lang.String alertTypeOID,
java.lang.String message)
Generates an administrative alert and updates the server's general monitor
entry to list the specified alert type as a degraded alert type.
|
UnavailableAlertType |
sendUnavailableAlertNotification(java.lang.String alertTypeName,
AlertSeverity severity,
java.lang.String alertTypeOID,
java.lang.String message)
Generates an administrative alert and updates the server's general monitor
entry to list the specified alert type as an unavailable alert type.
|
java.lang.String getShortVendorName()
java.lang.String getFullVendorName()
java.lang.String getCompactProductName()
java.lang.String getPackageName()
java.lang.String getFullProductName()
java.lang.String getBasicProductName()
int getMajorVersionNumber()
int getMinorVersionNumber()
int getPointVersionNumber()
int getPatchVersionNumber()
java.lang.String getVersionNumber()
java.lang.String getFullVersion()
java.lang.String getVersionQualifier()
java.lang.String getSourceRevision()
boolean isStarting()
true
if the server is in the process of starting up, or
false
if not.boolean isRunning()
true
if the server is running, or false
if not.boolean isShuttingDown()
true
if the server is in the process of shutting down, or
false
if not.long getStartTime()
java.lang.String getStartupID()
java.util.UUID getStartupUUID()
java.lang.String getInstanceName()
Location getLocation()
null
if no location has been assigned.java.io.File getServerRoot()
ToolExecutor getToolExecutor()
boolean isDirectoryFunctionalityAvailable()
true
if Directory Server functionality is available, or
false
if not.boolean isDirectoryProxyFunctionalityAvailable()
true
if Directory Proxy Server functionality is available,
or false
if not.boolean isSyncFunctionalityAvailable()
true
if Data Sync Server functionality is
available, or false
if not.InternalConnection getInternalRootConnection()
ClientContext
and wish to use the client connection policy
associated with that connection, use the
ClientContext.getInternalRootConnection(boolean)
method.InternalConnection getInternalConnection(java.lang.String dn) throws LDAPException
ClientContext
and wish to use the client connection policy
associated with that connection, use the
ClientContext.getInternalConnection(String,boolean)
method.dn
- The DN of the user as whom the connection should be
authenticated. It may be null
or empty if the
connection should be unauthenticated.LDAPException
- If a problem occurs while attempting to
authenticate as the specified user.LDAPInterface getClientRootConnection(boolean isClientSecure)
isClientSecure
parameter.isClientSecure
- Whether the external client is connected over a
secure channel.LDAPInterface getClientConnection(java.lang.String dn, boolean isClientSecure) throws LDAPException
isClientSecure
parameter.dn
- The DN of the user as whom the connection should be
authenticated. It may be null
or empty if the
connection should be unauthenticated.isClientSecure
- Whether the external client is connected over a
secure channel.LDAPException
- If a problem occurs while attempting to
authenticate as the specified user.Schema getSchema()
void registerSupportedControlOID(java.lang.String oid)
oid
- The OID to be registered.void deregisterSupportedControlOID(java.lang.String oid)
oid
- The OID to be deregistered.RegisteredChangeListener registerChangeListener(ChangeListener listener, java.util.Set<ChangeType> changeTypes, java.util.List<java.lang.String> baseDNs, Filter filter) throws LDAPException
listener
- The change listener to be registered with the server.
It must not be null
.changeTypes
- The types of changes for which the listener should be
registered. It may be null
or empty to
indicate that the listener should be registered for
all types of changes.baseDNs
- The set of base DNs for which the listener should be
registered. It may be null
or empty to
indicate that the listener should be registered for
changes processed anywhere in the server.filter
- A filter which may be used to restrict the set of
changes for which the listener is notified. If a
filter is provided, then only changes in which the
target entry matches the given filter (either before
or after the change was processed) will be notified.
It may be null
to indicate that the contents
of the entry should not be considered.LDAPException
- If a problem is encountered while attempting to
register the provided change listener (e.g., if any
of the base DNs cannot be parsed as a valid DN).void deregisterChangeListener(RegisteredChangeListener listener)
listener
- The change listener to be deregistered. It must not be
null
.RegisteredDiskSpaceConsumer registerDiskSpaceConsumer(DiskSpaceConsumer consumer)
consumer
- The disk space consumer to be registered with the server.
It must not be null
.void deregisterDiskSpaceConsumer(RegisteredDiskSpaceConsumer consumer)
consumer
- The disk space consumer to be deregistered with the
server. It must not be null
.RegisteredServerShutdownListener registerShutdownListener(ServerShutdownListener listener)
listener
- The server shutdown listener to be registered. It must
not be null
.void deregisterShutdownListener(RegisteredServerShutdownListener listener)
listener
- The server shutdown listener to be deregistered. It must
not be null
.RegisteredMonitorProvider registerMonitorProvider(MonitorProvider provider, GenericConfig config)
IllegalStateException
will be
thrown.
The generated monitor entry will have a DN in the following format:
cn={monitor-instance-name} [from {extension-type}:{extension-name}],
cn=monitor
and it will contain three auto-generated attributes:
ds-extension-monitor-name
, ds-extension-type
, and
ds-extension-name
. Note: the {extension-type} and
{extension-name} are from the extension which owns this ServerContext
instance, not from the given MonitorProvider object.
The specified monitor provider does not need any server-side configuration,
and the configuration-related methods
(initalizeMonitorProvider()
,
finalizeMonitorProvider()
,
defineConfigArguments()
,
isConfigurationAcceptable()
,
applyConfiguration()
) do not need to be implemented because
they will not be called.
When an extension is disabled, all of its registered monitor
providers will automatically deregister themselves from the server.
You can also manually deregister them using
deregisterMonitorProvider(RegisteredMonitorProvider)
or
deregisterAllMonitorProviders()
.
provider
- The monitor provider instance to be registered. It
must not be null
.config
- The configuration object from the extension that is
registering the given monitor provider. This is required so
that the monitor entry can be given a unique DN which
includes the name of the extension that registered it.void deregisterMonitorProvider(RegisteredMonitorProvider provider)
provider
- The monitor provider instance to be registered. It
must not be null
.void deregisterAllMonitorProviders()
ServerContext
. This can be useful during
cleanup or if you want to clear out all the existing monitor data from a
given extension and register new monitor providers.
This will be called automatically when your extension is unloaded or disabled.
java.lang.Thread createThread(ServerThread serverThread, java.lang.String name)
name
- The name to use for the thread. It must not be
null
or empty.serverThread
- The class providing the logic for the thread. It
must not be null
.void logMessage(LogSeverity severity, java.lang.String message)
severity
- The severity to use for the log message. It must not be
null
.message
- The message to be logged. It must not be null
.boolean isTraceMessageLoggable(LogSeverity logSeverity)
logSeverity
- The log message severity.
Must not be null
.true
if trace log messages from extensions are
loggable to any trace log publishersvoid logTraceMessage(LogSeverity logSeverity, java.lang.String message)
logSeverity
- The log message severity. If the log message may
contain potentially sensitive information,
LogSeverity.DEBUG
should be used.
Must not be null
.message
- The message to be logged. It must not be null
.void logTraceMessage(LogSeverity logSeverity, java.lang.String message, java.util.Map<java.lang.String,java.lang.String> keyValues)
logSeverity
- The log message severity. If the log message may
contain potentially sensitive information,
LogSeverity.DEBUG
should be used.
Must not be null
.message
- The message to be logged. It must not be null
.keyValues
- Keys and values that are to be logged with key=value.
Keys should not contain spaces or other special
characters. This map may be null
.void sendAlert(AlertSeverity severity, java.lang.String message)
severity
- The severity to use for the alert notification. It must
not be null
.message
- The message to be used for the alert notification. It
must not be null
.void sendAlert(java.lang.String alertTypeName, AlertSeverity severity, java.lang.String alertTypeOID, java.lang.String message) throws LDAPException
alertTypeName
- The name to use to identify the alert type. Each
kind of alert must have a distinct name and all
alerts with this alert type must always be used with
the same severity and OID values. Alert type names
must start with a lowercase ASCII letter and must
contain only lowercase ASCII letters, numeric
digits, and dashes.severity
- The severity to use for the alert notification.
It must not be null
.alertTypeOID
- The numeric OID for the alert type. It must not be
null
, and it must be a valid numeric OID.
The same OID must always be used for the associated
alert type, and each different alert type must have
a unique OID.message
- The message to be used for the alert notification.
It must not be null
.LDAPException
- If the provided information cannot be used to
generate a valid alert (e.g., if the alert type
name does not meet the naming constraints or has
already been used with a different severity and/or
OID, or if the OID has already been used with a
different alert type).DegradedAlertType sendDegradedAlertNotification(java.lang.String alertTypeName, AlertSeverity severity, java.lang.String alertTypeOID, java.lang.String message) throws LDAPException
DegradedAlertType.setResolved()
method should be used
to remove the alert type from the list of degraded alert types.
alertTypeName
- The name to use to identify the alert type. Each
kind of alert must have a distinct name and all
alerts with this alert type must always be used with
the same severity and OID values. Alert type names
must start with a lowercase ASCII letter and must
contain only lowercase ASCII letters, numeric
digits, and dashes.severity
- The severity to use for the alert notification.
It must not be null
.alertTypeOID
- The numeric OID for the alert type. It must not be
null
, and it must be a valid numeric OID.
The same OID must always be used for the associated
alert type, and each different alert type must have
a unique OID.message
- The message to be used for the alert notification.
It must not be null
.LDAPException
- If the provided information cannot be used to
generate a valid alert (e.g., if the alert type
name does not meet the naming constraints or has
already been used with a different severity and/or
OID, or if the OID has already been used with a
different alert type).UnavailableAlertType sendUnavailableAlertNotification(java.lang.String alertTypeName, AlertSeverity severity, java.lang.String alertTypeOID, java.lang.String message) throws LDAPException
UnavailableAlertType.setResolved()
method should
be used to remove the alert type from the list of unavailable alert types.
alertTypeName
- The name to use to identify the alert type. Each
kind of alert must have a distinct name and all
alerts with this alert type must always be used with
the same severity and OID values. Alert type names
must start with a lowercase ASCII letter and must
contain only lowercase ASCII letters, numeric
digits, and dashes.severity
- The severity to use for the alert notification.
It must not be null
.alertTypeOID
- The numeric OID for the alert type. It must not be
null
, and it must be a valid numeric OID.
The same OID must always be used for the associated
alert type, and each different alert type must have
a unique OID.message
- The message to be used for the alert notification.
It must not be null
.LDAPException
- If the provided information cannot be used to
generate a valid alert (e.g., if the alert type
name does not meet the naming constraints or has
already been used with a different severity and/or
OID, or if the OID has already been used with a
different alert type).boolean debugEnabled()
true
if debugging is enabled in the server, or
false
if not.void debugCaught(java.lang.Throwable t)
t
- The exception that has been caught.void debugThrown(java.lang.Throwable t)
t
- The exception that will be thrown.void debugError(java.lang.String message)
message
- The message to be debugged.void debugWarning(java.lang.String message)
message
- The message to be debugged.void debugInfo(java.lang.String message)
message
- The message to be debugged.void debugVerbose(java.lang.String message)
message
- The message to be debugged.LDAPConnection getLDAPExternalServerConnection(java.lang.String ldapExternalServerCfgObjectName, LDAPConnectionOptions connectionOptions) throws LDAPException
ldapExternalServerCfgObjectName
- The name of the configuration
object for the LDAP external
server to which the connection
should be established. It must
not be null
.connectionOptions
- The set of options to use for the
connection that is established.
It may be null
if a
default set of options should be
used.LDAPException
- If it is not possible to establish a connection to
the target servers.LDAPConnectionPool getLDAPExternalServerConnectionPool(java.lang.String ldapExternalServerCfgObjectName, LDAPConnectionOptions connectionOptions, int initialConnections, int maxConnections, boolean throwOnConnectFailure) throws LDAPException
ldapExternalServerCfgObjectName
- The name of the configuration
object for the LDAP external
server to which the connections
should be established. It must
not be null
.connectionOptions
- The set of options to use for the
connection that is established.
It may be null
if a
default set of options should be
used.initialConnections
- The initial number of connections
to attempt to establish. It must
be greater than or equal to zero.maxConnections
- The maximum number of connections
that should be established and
unused in the pool at any time.
It must be greater than or equal
to initialConnections
, and
it must not be zero.throwOnConnectFailure
- Indicates whether to throw an
LDAPException
if an error
is encountered while attempting to
connect or authenticate any of the
initial connections. If this is
false
and none of the
initial connections can be
established (or if the initial
number of connections is zero),
then the pool will be returned
without any connections.LDAPException
- If it is not possible to establish a pool of
connections to the specified LDAP external server.java.lang.String getObscuredValue(java.lang.String obscuredValueConfigObjectName) throws LDAPException
obscuredValueConfigObjectName
- The name of the configuration object
for the obscured value to retrieve.
It must not be null
.LDAPException
- If the provided name does not reference an obscured
value that is defined in the server configuration.ValueConstructor createValueConstructor(java.lang.String constructedValueTemplate) throws LDAPException
constructedValueTemplate
- The constructed value pattern. See
ValueConstructor
for details on
the syntax for the template.LDAPException
- If the provided value template is invalid.Group getGroup(java.lang.String groupDN) throws LDAPException
groupDN
- The DN of the entry containing the group to retrieve. It
must not be null
.LDAPException
- If the specified entry does not exist, if it exists
but does not represent a group, or if a problem is
encountered while retrieving the group.java.util.Map<DN,Group> getGroupsForUser(java.lang.String userDN, boolean directMembershipOnly) throws LDAPException
userDN
- The DN of the user for whom to retrieve the
associated groups. It must not be
null
.directMembershipOnly
- Indicates whether to only consider the user a
member of the group if that user is directly
named as a member of the group. If this
parameter is true
, then the method
will return true
only if the user is
directly listed as a member of the group, and
will not included dynamic or nested
membership. If this parameter is
false
, then the method will return
true
if the user is a direct member
of the group, is a member of a dynamic group
in which the user matches the membership
criteria, or if the user is a member of a
nested group.LDAPException
- If the specified user does not exist or if a
problem is encountered while attempting to retrieve
the groups in which the user is a member.boolean hasPrivilege(java.lang.String userDN, java.lang.String privilegeName) throws LDAPException
userDN
- The DN of the user for whom to make the
determination. It must not be null
.privilegeName
- The name of the privilege for which to make the
determination. It must not be null
.true
if the specified user has the indicated privilege, or
false
if not.LDAPException
- If the specified user does not exist, if the
indicated privilege is not defined in the server,
or if a problem is encountered while trying to make
the determination.java.util.Set<java.lang.String> getPrivilegeNames(java.lang.String userDN) throws LDAPException
userDN
- The DN of the user for whom to retrieve the privileges. It
must not be null
.LDAPException
- If the specified user does not exist, or if a
problem is encountered while attempting to retrieve
the user's privileges.void reloadHTTPConnectionHandlerCertificates() throws LDAPException
LDAPException
- If an error occurs.java.io.InputStream getPossiblyCompressedAndEncryptedInputStream(java.io.File file) throws LDAPException, java.security.GeneralSecurityException, java.io.IOException
PassphraseEncryptedOutputStream
using a key from the
server's encryption settings database, and may have optionally been
compressed with the GZIP compression algorithm. If the file is both
compressed and encrypted, then the data must have been compressed before
it was encrypted.file
- The file to be read. It must not be null
.LDAPException
- If a problem is encountered while interacting with
the server's encryption framework, or if the data
is encrypted with a key not contained in the
encryption settings database.java.security.GeneralSecurityException
- If a problem is encountered while
preparing to decrypt the data.java.io.IOException
- If a problem is encountered while attempting to read
or decompress the data.java.io.InputStream getPossiblyCompressedAndEncryptedInputStream(java.io.InputStream inputStream) throws LDAPException, java.security.GeneralSecurityException, java.io.IOException
PassphraseEncryptedOutputStream
, and if so,
retrieves an input stream that may be used to read its decrypted content.
Also examines the input stream to determine whether its contents may have
been GZIP-compressed, and if so, retrieves an input stream that may be used
to read its decompressed content. If the data is encrypted, it must start
with a PassphraseEncryptedStreamHeader
, and it must have been
encrypted with a key contained in the server's encryption settings
database. If the data is both compressed and encrypted, then it must have
been compressed before it was encrypted.
inputStream
- The input stream from which the data is to be
obtained. It must not be null
.LDAPException
- If a problem is encountered while interacting with
the server's encryption framework, or if the data
is encrypted with a key not contained in the
encryption settings database.java.security.GeneralSecurityException
- If a problem is encountered while
preparing to decrypt the data.java.io.IOException
- If a problem is encountered while attempting to read
or decompress the data.java.io.OutputStream getEncryptedOutputStream(java.io.OutputStream outputStream, boolean compress) throws LDAPException, java.io.IOException, java.security.GeneralSecurityException
PassphraseEncryptedOutputStream
so that data written to it will be
encrypted, optionally after also wrapping it in a GZIPOutputStream
to ensure that the data is compressed before it is encrypted. The
encryption key will be obtained from the server's preferred encryption
settings definition.outputStream
- The output stream to be wrapped. It must not be
null
.compress
- Indicates whether to GZIP-compress the data before
encrypting it.LDAPException
- If a problem is encountered while interacting with
the server's encryption framework or if the server
encryption settings database does not have a
preferred definition.java.security.GeneralSecurityException
- If a problem is encountered while
preparing to encrypt the data.java.io.IOException
- If a problem occurs while preparing to compress the
the data.java.io.OutputStream getEncryptedOutputStream(java.io.OutputStream outputStream, java.lang.String encryptionSettingsDefinitionID, boolean compress) throws LDAPException, java.security.GeneralSecurityException, java.io.IOException
PassphraseEncryptedOutputStream
so that data written to it will be
encrypted, optionally after also wrapping it in a GZIPOutputStream
to ensure that the data is compressed before it is encrypted.outputStream
- The output stream to be wrapped.
It must not be null
.encryptionSettingsDefinitionID
- The identifier of the encryption
settings definition that should be
used to encrypt the data. It must
not be null
.compress
- Indicates whether to GZIP-compress
the data before encrypting it.LDAPException
- If a problem is encountered while interacting with
the server's encryption framework, or if the
encryption settings database does not have a
definition with the specified ID.java.security.GeneralSecurityException
- If a problem is encountered while
preparing to encrypt the data.java.io.IOException
- If a problem occurs while preparing to compress the
the data.EncryptionSettingsDefinition getPreferredEncryptionSettingsDefinition()
null
if the server does not have a
preferred encryption settings definition.EncryptionSettingsDefinition getEncryptionSettingsDefinition(java.lang.String id)
id
- The identifier for the encryption settings definition to
retrieve. It must not be null
.null
if the encryption settings database does not have a
definition with the specified ID.java.util.List<EncryptionSettingsDefinition> getEncryptionSettingsDefinitions()
EMailMessage createEMailMessage(java.lang.String senderAddress, java.lang.String replyToAddress, java.util.Collection<java.lang.String> toAddresses, java.util.Collection<java.lang.String> ccAddresses, java.util.Collection<java.lang.String> bccAddresses, java.lang.String subject, java.lang.String plainTextPart, java.lang.String htmlPart, java.util.Map<java.lang.String,java.util.List<java.lang.String>> customHeaders, java.util.List<EMailAttachment> attachments) throws javax.mail.MessagingException
senderAddress
- The sender address for the email message. It must
not be null
or empty.replyToAddress
- The reply-to address for this email message. It
may be null
if no reply-to address is
needed. If it is non-null
, then it must
not be empty.toAddresses
- The set of "to" addresses for the email message.
At least one of the toAddresses
,
ccAddresses
, and bccAddresses
arguments must be non-null
and non-empty.ccAddresses
- The set of "cc" addresses for the email message.
At least one of the toAddresses
,
ccAddresses
, and bccAddresses
arguments must be non-null
and non-empty.bccAddresses
- The set of "bcc" addresses for the email message.
At least one of the toAddresses
,
ccAddresses
, and bccAddresses
arguments must be non-null
and non-empty.subject
- The subject for the email message. It must not be
null
or empty.plainTextPart
- The content for the plain-text-formatted body of
the message. It must not be null
if
htmlPart
is null
. If it is
non-null
, then it must not be empty.htmlPart
- The content for the HTML-formatted body of the
message. It must not be null
if
plainTextPart
is null
. If it is
non-null
, then it must not be empty.customHeaders
- An optional map of custom headers to include in the
email message. It may be null
or empty if
no custom headers should be included.attachments
- An optional set of attachments to include in the
email message. It may be null
or empty if
the message should not include any attachments.javax.mail.MessagingException
- If there is a problem with any of the
provided addresses.EMailAttachment createEMailAttachment(java.lang.String filename, java.lang.String contentType, boolean isInline, byte[] data)
filename
- The filename for this attachment. It must not be
null
or empty. It must be just the name of
the file, without any path information.contentType
- The MIME type for the email attachment. If this is
null
, then a default value of
"application/octet-stream" will be used.isInline
- Indicates whether the attachment is intended to be
referenced inline within the body of the email
message (e.g., an image displayed within the
HTML-formatted message).data
- The bytes that comprise the data for the attachment.
It must not be null
or empty.char[] getPassphraseFromPassphraseProvider(java.lang.String providerName, boolean allowCached) throws LDAPException
providerName
- The name or configuration entry DN for the passphrase
provider to invoke. It must not be null
.allowCached
- Indicates whether the provider may use a cached
version of the passphrase (if the provider supports
caching).null
.LDAPException
- If the requested passphrase provider is not defined
or enabled in the server configuration, or if a
problem occurs while invoking the passphrase
provider.