net.rubyeye.xmemcached.command
Class BinaryCommandFactory

java.lang.Object
  extended by net.rubyeye.xmemcached.command.BinaryCommandFactory
All Implemented Interfaces:
CommandFactory

public class BinaryCommandFactory
extends java.lang.Object
implements CommandFactory

Binary protocol command factory

Since:
1.2.0
Author:
dennis

Constructor Summary
BinaryCommandFactory()
           
 
Method Summary
 Command createAddCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
          create a add command
 Command createAppendCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
          create a append command
 Command createAuthListMechanismsCommand(java.util.concurrent.CountDownLatch latch)
          Create a command for listing authentication mechanisms
 Command createAuthStartCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
          Create command for starting authentication
 Command createAuthStepCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
          Create a command for stepping authentication
 Command createCASCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, long cas, boolean noreply, Transcoder transcoder)
          Create a cas command
 Command createDeleteCommand(java.lang.String key, byte[] keyBytes, int time, boolean noreply)
          create a delete command
 Command createFlushAllCommand(java.util.concurrent.CountDownLatch latch, int delay, boolean noreply)
          create a flush_all command
 Command createGetCommand(java.lang.String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder)
          create a get/gets command
<T> Command
createGetMultiCommand(java.util.Collection<java.lang.String> keys, java.util.concurrent.CountDownLatch latch, CommandType cmdType, Transcoder<T> transcoder)
          Create a multi-get command
 Command createIncrDecrCommand(java.lang.String key, byte[] keyBytes, long amount, long initial, int expTime, CommandType cmdType, boolean noreply)
          create a incr/decr command
 Command createPrependCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
          Create a prepend command
 Command createQuitCommand()
          create a quit command
 Command createReplaceCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
          create a replace command
 Command createSetCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
          Create a set command
 Command createStatsCommand(java.net.InetSocketAddress server, java.util.concurrent.CountDownLatch latch, java.lang.String itemName)
          create a stats command
 Command createVerbosityCommand(java.util.concurrent.CountDownLatch latch, int level, boolean noreply)
          Create a verbosity command
 Command createVersionCommand(java.util.concurrent.CountDownLatch latch, java.net.InetSocketAddress server)
          create a version command
 Protocol getProtocol()
          Get this client's protocol version
 void setBufferAllocator(BufferAllocator bufferAllocator)
          set command factory's buffer allocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryCommandFactory

public BinaryCommandFactory()
Method Detail

setBufferAllocator

public void setBufferAllocator(BufferAllocator bufferAllocator)
Description copied from interface: CommandFactory
set command factory's buffer allocator

Specified by:
setBufferAllocator in interface CommandFactory

createAddCommand

public Command createAddCommand(java.lang.String key,
                                byte[] keyBytes,
                                int exp,
                                java.lang.Object value,
                                boolean noreply,
                                Transcoder transcoder)
Description copied from interface: CommandFactory
create a add command

Specified by:
createAddCommand in interface CommandFactory
Returns:

createAppendCommand

public Command createAppendCommand(java.lang.String key,
                                   byte[] keyBytes,
                                   java.lang.Object value,
                                   boolean noreply,
                                   Transcoder transcoder)
Description copied from interface: CommandFactory
create a append command

Specified by:
createAppendCommand in interface CommandFactory
Returns:

createCASCommand

public Command createCASCommand(java.lang.String key,
                                byte[] keyBytes,
                                int exp,
                                java.lang.Object value,
                                long cas,
                                boolean noreply,
                                Transcoder transcoder)
Description copied from interface: CommandFactory
Create a cas command

Specified by:
createCASCommand in interface CommandFactory
Returns:

createDeleteCommand

public Command createDeleteCommand(java.lang.String key,
                                   byte[] keyBytes,
                                   int time,
                                   boolean noreply)
Description copied from interface: CommandFactory
create a delete command

Specified by:
createDeleteCommand in interface CommandFactory
Returns:

createFlushAllCommand

public Command createFlushAllCommand(java.util.concurrent.CountDownLatch latch,
                                     int delay,
                                     boolean noreply)
Description copied from interface: CommandFactory
create a flush_all command

Specified by:
createFlushAllCommand in interface CommandFactory
Returns:

createGetCommand

public Command createGetCommand(java.lang.String key,
                                byte[] keyBytes,
                                CommandType cmdType,
                                Transcoder transcoder)
Description copied from interface: CommandFactory
create a get/gets command

Specified by:
createGetCommand in interface CommandFactory
cmdType - 命令类型
transcoder - TODO
Returns:

createGetMultiCommand

public <T> Command createGetMultiCommand(java.util.Collection<java.lang.String> keys,
                                         java.util.concurrent.CountDownLatch latch,
                                         CommandType cmdType,
                                         Transcoder<T> transcoder)
Description copied from interface: CommandFactory
Create a multi-get command

Specified by:
createGetMultiCommand in interface CommandFactory
Returns:

createIncrDecrCommand

public Command createIncrDecrCommand(java.lang.String key,
                                     byte[] keyBytes,
                                     long amount,
                                     long initial,
                                     int expTime,
                                     CommandType cmdType,
                                     boolean noreply)
Description copied from interface: CommandFactory
create a incr/decr command

Specified by:
createIncrDecrCommand in interface CommandFactory
Returns:

createPrependCommand

public Command createPrependCommand(java.lang.String key,
                                    byte[] keyBytes,
                                    java.lang.Object value,
                                    boolean noreply,
                                    Transcoder transcoder)
Description copied from interface: CommandFactory
Create a prepend command

Specified by:
createPrependCommand in interface CommandFactory
Returns:

createReplaceCommand

public Command createReplaceCommand(java.lang.String key,
                                    byte[] keyBytes,
                                    int exp,
                                    java.lang.Object value,
                                    boolean noreply,
                                    Transcoder transcoder)
Description copied from interface: CommandFactory
create a replace command

Specified by:
createReplaceCommand in interface CommandFactory
Returns:

createSetCommand

public Command createSetCommand(java.lang.String key,
                                byte[] keyBytes,
                                int exp,
                                java.lang.Object value,
                                boolean noreply,
                                Transcoder transcoder)
Description copied from interface: CommandFactory
Create a set command

Specified by:
createSetCommand in interface CommandFactory
Returns:

createStatsCommand

public Command createStatsCommand(java.net.InetSocketAddress server,
                                  java.util.concurrent.CountDownLatch latch,
                                  java.lang.String itemName)
Description copied from interface: CommandFactory
create a stats command

Specified by:
createStatsCommand in interface CommandFactory
Returns:

createVerbosityCommand

public Command createVerbosityCommand(java.util.concurrent.CountDownLatch latch,
                                      int level,
                                      boolean noreply)
Description copied from interface: CommandFactory
Create a verbosity command

Specified by:
createVerbosityCommand in interface CommandFactory
Returns:

createVersionCommand

public Command createVersionCommand(java.util.concurrent.CountDownLatch latch,
                                    java.net.InetSocketAddress server)
Description copied from interface: CommandFactory
create a version command

Specified by:
createVersionCommand in interface CommandFactory
Returns:

createAuthListMechanismsCommand

public Command createAuthListMechanismsCommand(java.util.concurrent.CountDownLatch latch)
Description copied from interface: CommandFactory
Create a command for listing authentication mechanisms

Specified by:
createAuthListMechanismsCommand in interface CommandFactory
Returns:

createAuthStartCommand

public Command createAuthStartCommand(java.lang.String mechanism,
                                      java.util.concurrent.CountDownLatch latch,
                                      byte[] authData)
Description copied from interface: CommandFactory
Create command for starting authentication

Specified by:
createAuthStartCommand in interface CommandFactory
Returns:

createAuthStepCommand

public Command createAuthStepCommand(java.lang.String mechanism,
                                     java.util.concurrent.CountDownLatch latch,
                                     byte[] authData)
Description copied from interface: CommandFactory
Create a command for stepping authentication

Specified by:
createAuthStepCommand in interface CommandFactory
Returns:

createQuitCommand

public Command createQuitCommand()
Description copied from interface: CommandFactory
create a quit command

Specified by:
createQuitCommand in interface CommandFactory
Returns:

getProtocol

public Protocol getProtocol()
Description copied from interface: CommandFactory
Get this client's protocol version

Specified by:
getProtocol in interface CommandFactory
Returns:


Copyright © 2011. All Rights Reserved.