Interface OperationContext

    • Method Detail

      • getConnectionID

        long getConnectionID()
        Retrieves the identifier that has been assigned to the associated client connection.
        Returns:
        The identifier that has been assigned to the associated client connection.
      • getOperationID

        long getOperationID()
        Retrieves the identifier that has been assigned to this operation for the associated client connection.
        Returns:
        The identifier that has been assigned to this operation for the associated client connection.
      • getMessageID

        int getMessageID()
        Retrieves the message ID for this operation from the client request.
        Returns:
        The message ID for this operation from the client request.
      • getOperationType

        OperationType getOperationType()
        Retrieves the operation type for this operation.
        Returns:
        The operation type for this operation.
      • getRequest

        Request getRequest()
        Retrieves the request for the associated operation. The caller should not make any attempt to alter the request that is returned.
        Returns:
        The request for the associated operation.
      • getServerContext

        ServerContext getServerContext()
        Retrieves information about the server in which this operation is being processed.
        Returns:
        Information about the server in which this operation is being processed.
      • isInternalOperation

        boolean isInternalOperation()
        Indicates whether this operation was initiated within the server rather than by an external client.
        Returns:
        true if this operation was initiated within the server, or false if it was requested by an external client.
      • isAdministrativeOperation

        boolean isAdministrativeOperation()
        Indicates whether this is an administrative operation. An operation is considered administrative if the StartAdministrativeSessionExtendedRequest extended request was used on the connection, or the AdministrativeOperationRequestControl request control was used on the operation.
        Returns:
        true if this operation is an administrative operation.
      • isReplicationOperation

        boolean isReplicationOperation()
        Indicates whether this operation was initiated via replication rather than within the local server.
        Returns:
        true if this operation was initiated via replication, or false if it was initiated locally within this server.
      • getAuthorizationDN

        java.lang.String getAuthorizationDN()
        Retrieves the DN of the user as whom the request is authorized. Note that this may change over the course of processing the operation (e.g., if the request includes a proxied authorization or intermediate client control).
        Returns:
        The DN of the user as whom the request is authorized. It may be an empty string if the operation is to be authorized as an unauthenticated user.
      • getAttachment

        java.lang.Object getAttachment​(java.lang.String name)
        Retrieves the object attached to the associated operation with the given name.
        Parameters:
        name - The case-sensitive name of the attachment to retrieve. It must not be null.
        Returns:
        The requested attachment, or null if the operation does not have an attachment with the provided name.
      • setAttachment

        void setAttachment​(java.lang.String name,
                           java.lang.Object value)
        Sets an attachment for the associated operation.
        Parameters:
        name - The name of the attachment to set. It must not be null.
        value - The value to set for the attachment. It may be null if any existing attachment with the specified name should be removed.
      • getClientContext

        ClientContext getClientContext()
        Retrieves information about the client that requested this operation.
        Returns:
        Information about the client that requested this operation.
      • getClientConnectionPolicyName

        java.lang.String getClientConnectionPolicyName()
        Retrieves the name of the client connection policy to which the associated client connection is assigned.
        Returns:
        The name of the client connection policy to which the associated client connection is assigned.
      • getClientConnectionPolicyDN

        java.lang.String getClientConnectionPolicyDN()
        Retrieves the DN of the entry that defines the client connection policy to which the associated client connection is assigned.
        Returns:
        The DN of the entry that defines the client connection policy to which the associated client connection policy is assigned.
      • isSecure

        boolean isSecure()
        Indicates whether this operation was requested over a secure connection. If the request included the intermediate client control, then its value will also be used in determining whether communication with downstream clients is also secure.
        Returns:
        true if this operation was requested over a secure connection, or false if not.
      • getInternalUserConnection

        InternalConnection getInternalUserConnection()
                                              throws LDAPException
        Retrieves an internal connection that is authenticated as the same user that requested this operation and may be subject to access control.

        Note that the returned connection will use the client connection policy defined as the default policy for internal operations. If you wish to use the client connection policy associated with the connection on which this operation was requested, use the getInternalUserConnection(boolean) method.
        Returns:
        An internal connection that is authenticated as the same user that requested this operation.
        Throws:
        LDAPException - If a problem occurs while attempting to obtain or authenticate the connection.
      • getInternalUserConnection

        InternalConnection getInternalUserConnection​(boolean usePolicyFromConnection)
                                              throws LDAPException
        Retrieves an internal connection that is authenticated as the same user that requested this operation and may be subject to access control. It may optionally use the client connection policy from the associated client connection.
        Parameters:
        usePolicyFromConnection - If true, the internal connection will use the same client connection policy as the associated client connection. If false, the internal connection will use the server's default client connection policy for internal connections.
        Returns:
        An internal connection that is authenticated as the same user that requested this operation.
        Throws:
        LDAPException - If a problem occurs while attempting to obtain or authenticate the connection.
      • getInternalRootConnection

        InternalConnection getInternalRootConnection()
        Retrieves an internal connection that is authenticated as a root user that is not subject to access control.

        Note that the returned connection will use the client connection policy defined as the default policy for internal operations. If you wish to use the client connection policy associated with the connection on which this operation was requested, use the getInternalRootConnection(boolean) method.
        Returns:
        An internal connection that is authenticated as a root user.
      • getInternalRootConnection

        InternalConnection getInternalRootConnection​(boolean usePolicyFromConnection)
        Retrieves an internal connection that is authenticated as a root user that is not subject to access control. It may optionally use the client connection policy from the associated client connection.
        Parameters:
        usePolicyFromConnection - If true, the internal connection will use the same client connection policy as the associated client connection. If false, the internal connection will use the server's default client connection policy for internal connections.
        Returns:
        An internal connection that is authenticated as a root user.
      • toString

        java.lang.String toString()
        Retrieves a string representation of this operation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this operation.
      • addCustomLogElement

        void addCustomLogElement​(java.lang.String key,
                                 java.lang.Object value)
        Specifies an additional log element for this operation, which should be written to the log.
        Parameters:
        key - The key of the log element being added
        value - The value of the log element being added
      • addCustomLogElement

        void addCustomLogElement​(LogField field,
                                 java.lang.Object value)
        Specifies an additional log element for this operation, which should be written to the log.
        Parameters:
        field - The field for the log element being added
        value - The value of the log element being added
      • getCustomLogElements

        java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getCustomLogElements()
        Returns any additional log elements for this operation, which should be written to the log.
        Returns:
        map of additional log elements to a list of values.
      • appendAdditionalLogMessage

        void appendAdditionalLogMessage​(java.lang.String message)
        Indicates that the provided message should be included in the access log message for the operation but should not be returned to the client.
        Parameters:
        message - The message to include in the log message. It must not be null.
      • deregisterOperationCompletedListener

        void deregisterOperationCompletedListener​(RegisteredOperationCompletedListener listener)
        Deregisters the provided server operation completed listener with the server. This will have no effect if the provided listener is not registered.
        Parameters:
        listener - The server operation completed listener to be deregistered. It must not be null.