Package net.rubyeye.xmemcached
Interface CommandFactory
-
- All Known Implementing Classes:
BinaryCommandFactory,KestrelCommandFactory,TextCommandFactory
public interface CommandFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommandcreateAddCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder)create a add commandCommandcreateAppendCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder)create a append commandCommandcreateAuthListMechanismsCommand(CountDownLatch latch)Create a command for listing authentication mechanismsCommandcreateAuthStartCommand(String mechanism, CountDownLatch latch, byte[] authData)Create command for starting authenticationCommandcreateAuthStepCommand(String mechanism, CountDownLatch latch, byte[] authData)Create a command for stepping authenticationCommandcreateAWSElasticCacheConfigCommand(String subCommand, String key)Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.CommandcreateCASCommand(String key, byte[] keyBytes, int exp, Object value, long cas, boolean noreply, Transcoder transcoder)Create a cas commandCommandcreateDeleteCommand(String key, byte[] keyBytes, int time, long cas, boolean noreply)create a delete commandCommandcreateFlushAllCommand(CountDownLatch latch, int delay, boolean noreply)create a flush_all commandCommandcreateGetAndTouchCommand(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply)Create a get-and-touch commandCommandcreateGetCommand(String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder)create a get/gets command<T> CommandcreateGetMultiCommand(Collection<String> keys, CountDownLatch latch, CommandType cmdType, Transcoder<T> transcoder)Create a multi-get commandCommandcreateIncrDecrCommand(String key, byte[] keyBytes, long delta, long initial, int expTime, CommandType cmdType, boolean noreply)create a incr/decr commandCommandcreatePrependCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder)Create a prepend commandCommandcreateQuitCommand()create a quit commandCommandcreateReplaceCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder)create a replace commandCommandcreateSetCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder)Create a set commandCommandcreateStatsCommand(InetSocketAddress server, CountDownLatch latch, String itemName)create a stats commandCommandcreateTouchCommand(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply)Create a touch commandCommandcreateVerbosityCommand(CountDownLatch latch, int level, boolean noreply)Create a verbosity commandCommandcreateVersionCommand(CountDownLatch latch, InetSocketAddress server)create a version commandProtocolgetProtocol()Get this client's protocol versionvoidsetBufferAllocator(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(String key, byte[] keyBytes, int time, long cas, boolean noreply)
create a delete command- Parameters:
key-time-- Returns:
-
createVersionCommand
Command createVersionCommand(CountDownLatch latch, InetSocketAddress server)
create a version command- Returns:
-
createFlushAllCommand
Command createFlushAllCommand(CountDownLatch latch, int delay, boolean noreply)
create a flush_all command- Returns:
-
createStatsCommand
Command createStatsCommand(InetSocketAddress server, CountDownLatch latch, String itemName)
create a stats command- Returns:
-
createGetCommand
Command createGetCommand(String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder)
create a get/gets command- Parameters:
key-keyBytes-cmdType- 命令类型transcoder- TODOcmdBytes- 命令的字节数组,如"get".getBytes()- Returns:
-
createGetMultiCommand
<T> Command createGetMultiCommand(Collection<String> keys, 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(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- TODOexp-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- TODOexp-noreply-- Returns:
- Since:
- 1.3.3
-
createAWSElasticCacheConfigCommand
Command createAWSElasticCacheConfigCommand(String subCommand, String key)
Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.- Parameters:
subCommand-key-- Returns:
- See Also:
- Adding Auto Discovery To Your Client Library
-
getProtocol
Protocol getProtocol()
Get this client's protocol version- Returns:
-
-