net.rubyeye.xmemcached
Interface CommandFactory

All Known Implementing Classes:
BinaryCommandFactory, KestrelCommandFactory, TextCommandFactory

public interface CommandFactory


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 delta, 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
 

Method Detail

setBufferAllocator

void setBufferAllocator(BufferAllocator bufferAllocator)
set command factory's buffer allocator

Parameters:
bufferAllocator -
Since:
1.2.0

createDeleteCommand

Command createDeleteCommand(java.lang.String key,
                            byte[] keyBytes,
                            int time,
                            boolean noreply)
create a delete command

Parameters:
key -
time -
Returns:

createVersionCommand

Command createVersionCommand(java.util.concurrent.CountDownLatch latch,
                             java.net.InetSocketAddress server)
create a version command

Returns:

createFlushAllCommand

Command createFlushAllCommand(java.util.concurrent.CountDownLatch latch,
                              int delay,
                              boolean noreply)
create a flush_all command

Returns:

createStatsCommand

Command createStatsCommand(java.net.InetSocketAddress server,
                           java.util.concurrent.CountDownLatch latch,
                           java.lang.String itemName)
create a stats command

Returns:

createGetCommand

Command createGetCommand(java.lang.String key,
                         byte[] keyBytes,
                         CommandType cmdType,
                         Transcoder transcoder)
create a get/gets command

Parameters:
key -
keyBytes -
cmdType - 命令类型
transcoder - TODO
cmdBytes - 命令的字节数组,如"get".getBytes()
Returns:

createGetMultiCommand

<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

Type Parameters:
T -
Parameters:
keys -
latch -
result -
cmdBytes -
cmdType -
transcoder -
Returns:

createIncrDecrCommand

Command createIncrDecrCommand(java.lang.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(java.lang.String key,
                         byte[] keyBytes,
                         int exp,
                         java.lang.Object value,
                         long cas,
                         boolean noreply,
                         Transcoder transcoder)
Create a cas command

Parameters:
key -
keyBytes -
exp -
value -
cas -
noreply -
transcoder -
Returns:

createSetCommand

Command createSetCommand(java.lang.String key,
                         byte[] keyBytes,
                         int exp,
                         java.lang.Object value,
                         boolean noreply,
                         Transcoder transcoder)
Create a set command

Parameters:
key -
keyBytes -
exp -
value -
noreply -
transcoder -
Returns:

createAddCommand

Command createAddCommand(java.lang.String key,
                         byte[] keyBytes,
                         int exp,
                         java.lang.Object value,
                         boolean noreply,
                         Transcoder transcoder)
create a add command

Parameters:
key -
keyBytes -
exp -
value -
noreply -
transcoder -
Returns:

createReplaceCommand

Command createReplaceCommand(java.lang.String key,
                             byte[] keyBytes,
                             int exp,
                             java.lang.Object value,
                             boolean noreply,
                             Transcoder transcoder)
create a replace command

Parameters:
key -
keyBytes -
exp -
value -
noreply -
transcoder -
Returns:

createAppendCommand

Command createAppendCommand(java.lang.String key,
                            byte[] keyBytes,
                            java.lang.Object value,
                            boolean noreply,
                            Transcoder transcoder)
create a append command

Parameters:
key -
keyBytes -
value -
noreply -
transcoder -
Returns:

createPrependCommand

Command createPrependCommand(java.lang.String key,
                             byte[] keyBytes,
                             java.lang.Object value,
                             boolean noreply,
                             Transcoder transcoder)
Create a prepend command

Parameters:
key -
keyBytes -
value -
noreply -
transcoder -
Returns:

createVerbosityCommand

Command createVerbosityCommand(java.util.concurrent.CountDownLatch latch,
                               int level,
                               boolean noreply)
Create a verbosity command

Parameters:
latch -
level -
noreply -
Returns:

createAuthListMechanismsCommand

Command createAuthListMechanismsCommand(java.util.concurrent.CountDownLatch latch)
Create a command for listing authentication mechanisms

Parameters:
latch -
Returns:

createAuthStartCommand

Command createAuthStartCommand(java.lang.String mechanism,
                               java.util.concurrent.CountDownLatch latch,
                               byte[] authData)
Create command for starting authentication

Parameters:
mechanism -
latch -
authData -
Returns:

createAuthStepCommand

Command createAuthStepCommand(java.lang.String mechanism,
                              java.util.concurrent.CountDownLatch latch,
                              byte[] authData)
Create a command for stepping authentication

Parameters:
mechanism -
latch -
authData -
Returns:

createQuitCommand

Command createQuitCommand()
create a quit command

Returns:

getProtocol

Protocol getProtocol()
Get this client's protocol version

Returns:


Copyright © 2011. All Rights Reserved.