Package org.ldaptive

Class AbstractOperation<Q extends Request,​S extends Result>

    • Field Detail

      • resultHandlers

        private ResultHandler[] resultHandlers
        Functions to handle response results.
      • referralHandlers

        private ReferralHandler[] referralHandlers
        Functions to handle referrals.
      • intermediateResponseHandlers

        private IntermediateResponseHandler[] intermediateResponseHandlers
        Functions to handle intermediate responses.
      • exceptionHandler

        private ExceptionHandler exceptionHandler
        Function to handle exceptions.
      • throwCondition

        private ResultPredicate throwCondition
        Function to test results.
      • unsolicitedNotificationHandlers

        private UnsolicitedNotificationHandler[] unsolicitedNotificationHandlers
        Functions to handle unsolicited notifications.
    • Constructor Detail

      • AbstractOperation

        public AbstractOperation()
        Default constructor.
      • AbstractOperation

        public AbstractOperation​(ConnectionFactory factory)
        Creates a new abstract operation.
        Parameters:
        factory - connection factory
    • Method Detail

      • setConnectionFactory

        public void setConnectionFactory​(ConnectionFactory factory)
      • setRequestHandlers

        public void setRequestHandlers​(RequestHandler<Q>... handlers)
      • setResultHandlers

        public void setResultHandlers​(ResultHandler... handlers)
      • setReferralHandlers

        public void setReferralHandlers​(ReferralHandler... handlers)
      • setExceptionHandler

        public void setExceptionHandler​(ExceptionHandler handler)
      • setThrowCondition

        public void setThrowCondition​(ResultPredicate function)
      • configureRequest

        protected Q configureRequest​(Q request)
        Applies any configured request handlers to the supplied request. Returns the supplied request unaltered if no request handlers are configured.
        Parameters:
        request - to configure
        Returns:
        configured request
      • configureHandle

        protected OperationHandle<Q,​S> configureHandle​(OperationHandle<Q,​S> handle)
        Adds configured functions to the supplied handle.
        Parameters:
        handle - to configure
        Returns:
        configured handle
      • copy

        protected static <Q extends Request,​S extends Result> void copy​(AbstractOperation<Q,​S> from,
                                                                              AbstractOperation<Q,​S> to,
                                                                              boolean deep)
        Copies properties from one operation to another.
        Type Parameters:
        Q - type of request
        S - type of result
        Parameters:
        from - to copy properties from
        to - to copy properties to
        deep - whether to make a deep copy