Class StartAdministrativeSessionExtendedRequest
- java.lang.Object
-
- com.unboundid.ldap.sdk.LDAPRequest
-
- com.unboundid.ldap.sdk.ExtendedRequest
-
- com.unboundid.ldap.sdk.unboundidds.extensions.StartAdministrativeSessionExtendedRequest
-
- All Implemented Interfaces:
ProtocolOp
,ReadOnlyLDAPRequest
,java.io.Serializable
@NotMutable @ThreadSafety(level=NOT_THREADSAFE) public final class StartAdministrativeSessionExtendedRequest extends ExtendedRequest
This class provides an implementation of the start administrative session extended request, which clients may use to indicate that they are going to perform a set of administrative operations in the server. It may be used to identify the client to the server and to indicate whether subsequent requests received on the connection should be processed using worker threads in a dedicated thread pool (subject to server configuration restrictions).
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
This extended request has an OID of 1.3.6.1.4.1.30221.2.6.13, and it must have a value with the following encoding:StartAdminSessionValue ::= SEQUENCE { clientName [0] OCTET STRING OPTIONAL, useDedicatedThreadPool [1] BOOLEAN DEFAULT FALSE, ... }
Example
The following example demonstrates the process for creating an administrative session and using that session to request monitor information using a dedicated worker thread.// Establish a connection to the server. LDAPConnection connection = new LDAPConnection(host, port); // Use the start administrative session operation to begin an administrative // session and request that operations in the session use the dedicated // thread pool. ExtendedResult extendedResult = connection.processExtendedOperation( new StartAdministrativeSessionExtendedRequest("Test Client", true)); // Authenticate the connection. It is strongly recommended that the // administrative session be created before the connection is authenticated. // Attempting to authenticate the connection before creating the // administrative session may result in the bind using a "regular" worker // thread rather than an administrative session worker thread, and if all // normal worker threads are busy or stuck, then the bind request may be // blocked. BindResult bindResult = connection.bind(userDN, password); // Use the connection to perform operations that may benefit from using an // administrative session (e.g., operations that troubleshoot and attempt to // correct some problem with the server). In this example, we'll just // request all monitor entries from the server. List<MonitorEntry> monitorEntries = MonitorManager.getMonitorEntries(connection); // Use the end administrative session operation to end the administrative // session and resume using normal worker threads for subsequent operations. // This isn't strictly needed if we just want to close the connection. extendedResult = connection.processExtendedOperation( new EndAdministrativeSessionExtendedRequest()); // Do other operations that don't need an administrative session. connection.close();
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
START_ADMIN_SESSION_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.6.13) for the start administrative session extended request.-
Fields inherited from class com.unboundid.ldap.sdk.ExtendedRequest
TYPE_EXTENDED_REQUEST_OID, TYPE_EXTENDED_REQUEST_VALUE
-
-
Constructor Summary
Constructors Constructor Description StartAdministrativeSessionExtendedRequest(ExtendedRequest extendedRequest)
Creates a new start administrative session extended request from the provided generic extended request.StartAdministrativeSessionExtendedRequest(java.lang.String clientName, boolean useDedicatedThreadPool, Control... controls)
Creates a new start administrative session extended request with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StartAdministrativeSessionExtendedRequest
duplicate()
Creates a new instance of this LDAP request that may be modified without impacting this request.StartAdministrativeSessionExtendedRequest
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without impacting this request.java.lang.String
getClientName()
Retrieves the name of the client application issuing this request, if available.java.lang.String
getExtendedRequestName()
Retrieves the user-friendly name for the extended request, if available.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.boolean
useDedicatedThreadPool()
Indicates whether the server should attempt to use a dedicated worker thread pool for requests from this client.-
Methods inherited from class com.unboundid.ldap.sdk.ExtendedRequest
encodeProtocolOp, getLastMessageID, getOID, getOperationType, getProtocolOpType, getValue, hasValue, process, responseReceived, toCode, writeTo
-
Methods inherited from class com.unboundid.ldap.sdk.LDAPRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setResponseTimeoutMillis, toString
-
-
-
-
Field Detail
-
START_ADMIN_SESSION_REQUEST_OID
@NotNull public static final java.lang.String START_ADMIN_SESSION_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.6.13) for the start administrative session extended request.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StartAdministrativeSessionExtendedRequest
public StartAdministrativeSessionExtendedRequest(@Nullable java.lang.String clientName, boolean useDedicatedThreadPool, @Nullable Control... controls)
Creates a new start administrative session extended request with the provided information.- Parameters:
clientName
- The name of the client application issuing this request. It may benull
if no client name should be provided.useDedicatedThreadPool
- Indicates whether the server should use a dedicated worker thread pool for requests processed by this client. Note that the server may define restrictions around the use of a dedicated thread pool.controls
- The set of controls to include in the request.
-
StartAdministrativeSessionExtendedRequest
public StartAdministrativeSessionExtendedRequest(@NotNull ExtendedRequest extendedRequest) throws LDAPException
Creates a new start administrative session extended request from the provided generic extended request.- Parameters:
extendedRequest
- The generic extended request to use to create this start administrative session extended request.- Throws:
LDAPException
- If a problem occurs while decoding the request.
-
-
Method Detail
-
getClientName
@Nullable public java.lang.String getClientName()
Retrieves the name of the client application issuing this request, if available.- Returns:
- The name of the client application issuing this request, or
null
if it was not included in the request.
-
useDedicatedThreadPool
public boolean useDedicatedThreadPool()
Indicates whether the server should attempt to use a dedicated worker thread pool for requests from this client.- Returns:
true
if the server should attempt to use a dedicated worker thread pool for requests from this client, orfalse
if not.
-
duplicate
@NotNull public StartAdministrativeSessionExtendedRequest duplicate()
Creates a new instance of this LDAP request that may be modified without impacting this request.. Subclasses should override this method to return a duplicate of the appropriate type.- Specified by:
duplicate
in interfaceReadOnlyLDAPRequest
- Overrides:
duplicate
in classExtendedRequest
- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
duplicate
@NotNull public StartAdministrativeSessionExtendedRequest duplicate(@Nullable Control[] controls)
Creates a new instance of this LDAP request that may be modified without impacting this request. The provided controls will be used for the new request instead of duplicating the controls from this request.. Subclasses should override this method to return a duplicate of the appropriate type.- Specified by:
duplicate
in interfaceReadOnlyLDAPRequest
- Overrides:
duplicate
in classExtendedRequest
- Parameters:
controls
- The set of controls to include in the duplicate request.- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
getExtendedRequestName
@NotNull public java.lang.String getExtendedRequestName()
Retrieves the user-friendly name for the extended request, if available. If no user-friendly name has been defined, then the OID will be returned.- Overrides:
getExtendedRequestName
in classExtendedRequest
- Returns:
- The user-friendly name for this extended request, or the OID if no user-friendly name is available.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.- Specified by:
toString
in interfaceProtocolOp
- Specified by:
toString
in interfaceReadOnlyLDAPRequest
- Overrides:
toString
in classExtendedRequest
- Parameters:
buffer
- The buffer to which to append a string representation of this request.
-
-