Interface CommandFactory

    • Method Detail

      • setBufferAllocator

        void setBufferAllocator​(BufferAllocator bufferAllocator)
        set command factory's buffer allocator
        Parameters:
        bufferAllocator -
        Since:
        1.2.0
      • createDeleteCommand

        Command createDeleteCommand​(String key,
                                    byte[] keyBytes,
                                    int time,
                                    long cas,
                                    boolean noreply)
        create a delete command
        Parameters:
        key -
        time -
        Returns:
      • createFlushAllCommand

        Command createFlushAllCommand​(CountDownLatch latch,
                                      int delay,
                                      boolean noreply)
        create a flush_all command
        Returns:
      • createGetCommand

        Command createGetCommand​(String key,
                                 byte[] keyBytes,
                                 CommandType cmdType,
                                 Transcoder transcoder)
        create a get/gets command
        Parameters:
        key -
        keyBytes -
        cmdType - 命令类型
        transcoder - TODO
        cmdBytes - 命令的字节数组,如"get".getBytes()
        Returns:
      • createIncrDecrCommand

        Command createIncrDecrCommand​(String key,
                                      byte[] keyBytes,
                                      long delta,
                                      long initial,
                                      int expTime,
                                      CommandType cmdType,
                                      boolean noreply)
        create a incr/decr command
        Parameters:
        key -
        keyBytes -
        delta -
        initial -
        expTime -
        cmdType -
        noreply -
        Returns:
      • createCASCommand

        Command createCASCommand​(String key,
                                 byte[] keyBytes,
                                 int exp,
                                 Object value,
                                 long cas,
                                 boolean noreply,
                                 Transcoder transcoder)
        Create a cas command
        Parameters:
        key -
        keyBytes -
        exp -
        value -
        cas -
        noreply -
        transcoder -
        Returns:
      • createSetCommand

        Command createSetCommand​(String key,
                                 byte[] keyBytes,
                                 int exp,
                                 Object value,
                                 boolean noreply,
                                 Transcoder transcoder)
        Create a set command
        Parameters:
        key -
        keyBytes -
        exp -
        value -
        noreply -
        transcoder -
        Returns:
      • createAddCommand

        Command createAddCommand​(String key,
                                 byte[] keyBytes,
                                 int exp,
                                 Object value,
                                 boolean noreply,
                                 Transcoder transcoder)
        create a add command
        Parameters:
        key -
        keyBytes -
        exp -
        value -
        noreply -
        transcoder -
        Returns:
      • createReplaceCommand

        Command createReplaceCommand​(String key,
                                     byte[] keyBytes,
                                     int exp,
                                     Object value,
                                     boolean noreply,
                                     Transcoder transcoder)
        create a replace command
        Parameters:
        key -
        keyBytes -
        exp -
        value -
        noreply -
        transcoder -
        Returns:
      • createAppendCommand

        Command createAppendCommand​(String key,
                                    byte[] keyBytes,
                                    Object value,
                                    boolean noreply,
                                    Transcoder transcoder)
        create a append command
        Parameters:
        key -
        keyBytes -
        value -
        noreply -
        transcoder -
        Returns:
      • createPrependCommand

        Command createPrependCommand​(String key,
                                     byte[] keyBytes,
                                     Object value,
                                     boolean noreply,
                                     Transcoder transcoder)
        Create a prepend command
        Parameters:
        key -
        keyBytes -
        value -
        noreply -
        transcoder -
        Returns:
      • createVerbosityCommand

        Command createVerbosityCommand​(CountDownLatch latch,
                                       int level,
                                       boolean noreply)
        Create a verbosity command
        Parameters:
        latch -
        level -
        noreply -
        Returns:
      • createAuthListMechanismsCommand

        Command createAuthListMechanismsCommand​(CountDownLatch latch)
        Create a command for listing authentication mechanisms
        Parameters:
        latch -
        Returns:
      • createAuthStartCommand

        Command createAuthStartCommand​(String mechanism,
                                       CountDownLatch latch,
                                       byte[] authData)
        Create command for starting authentication
        Parameters:
        mechanism -
        latch -
        authData -
        Returns:
      • createAuthStepCommand

        Command createAuthStepCommand​(String mechanism,
                                      CountDownLatch latch,
                                      byte[] authData)
        Create a command for stepping authentication
        Parameters:
        mechanism -
        latch -
        authData -
        Returns:
      • createQuitCommand

        Command createQuitCommand()
        create a quit command
        Returns:
      • createTouchCommand

        Command createTouchCommand​(String key,
                                   byte[] keyBytes,
                                   CountDownLatch latch,
                                   int exp,
                                   boolean noreply)
        Create a touch command
        Parameters:
        key -
        keyBytes -
        latch - TODO
        exp -
        noreply -
        Returns:
        Since:
        1.3.3
      • createGetAndTouchCommand

        Command createGetAndTouchCommand​(String key,
                                         byte[] keyBytes,
                                         CountDownLatch latch,
                                         int exp,
                                         boolean noreply)
        Create a get-and-touch command
        Parameters:
        key -
        keyBytes -
        latch - TODO
        exp -
        noreply -
        Returns:
        Since:
        1.3.3
      • getProtocol

        Protocol getProtocol()
        Get this client's protocol version
        Returns: