Package org.ldaptive

Class AbstractOperation.AbstractBuilder<B,​T extends AbstractOperation>

    • Constructor Detail

      • AbstractBuilder

        protected AbstractBuilder​(T t)
        Creates a new abstract builder.
        Parameters:
        t - operation to build
    • Method Detail

      • self

        protected abstract B self()
        Returns this builder.
        Returns:
        builder
      • factory

        public B factory​(ConnectionFactory factory)
        Sets the connection factory.
        Parameters:
        factory - to set
        Returns:
        this builder
      • onRequest

        public B onRequest​(RequestHandler... handlers)
        Sets the functions to execute before a request is sent.
        Parameters:
        handlers - to execute on a request
        Returns:
        this builder
      • onResult

        public B onResult​(ResultHandler... handlers)
        Sets the functions to execute when a result is received.
        Parameters:
        handlers - to execute on a result
        Returns:
        this builder
      • onControl

        public B onControl​(ResponseControlHandler... handlers)
        Sets the functions to execute when a control is received.
        Parameters:
        handlers - to execute on a control
        Returns:
        this builder
      • onReferral

        public B onReferral​(ReferralHandler... handlers)
        Sets the functions to execute when a referral is received.
        Parameters:
        handlers - to execute on a referral
        Returns:
        this builder
      • onIntermediate

        public B onIntermediate​(IntermediateResponseHandler... handlers)
        Sets the functions to execute when an intermediate response is received.
        Parameters:
        handlers - to execute on an intermediate response
        Returns:
        this builder
      • onUnsolicitedNotification

        public B onUnsolicitedNotification​(UnsolicitedNotificationHandler... handlers)
        Sets the functions to execute when an unsolicited notification is received.
        Parameters:
        handlers - to execute on an unsolicited notification
        Returns:
        this builder
      • onException

        public B onException​(ExceptionHandler handler)
        Sets the function to execute when an exception occurs.
        Parameters:
        handler - to execute on an exception occurs
        Returns:
        this builder
      • throwIf

        public B throwIf​(ResultPredicate function)
        Sets the function to test a result.
        Parameters:
        function - to test a result
        Returns:
        this builder
      • build

        public T build()
        Returns the operation.
        Returns:
        operation