Class 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();
     
    See Also:
    EndAdministrativeSessionExtendedRequest, Serialized Form
    • 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 be null 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, or false if not.
      • 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 interface ReadOnlyLDAPRequest
        Overrides:
        duplicate in class ExtendedRequest
        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 class ExtendedRequest
        Returns:
        The user-friendly name for this extended request, or the OID if no user-friendly name is available.