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 Command
createAddCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
create a add commandCommand
createAppendCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
create a append commandCommand
createAuthListMechanismsCommand(java.util.concurrent.CountDownLatch latch)
Create a command for listing authentication mechanismsCommand
createAuthStartCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
Create command for starting authenticationCommand
createAuthStepCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
Create a command for stepping authenticationCommand
createAWSElasticCacheConfigCommand(java.lang.String subCommand, java.lang.String key)
Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.Command
createCASCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, long cas, boolean noreply, Transcoder transcoder)
Create a cas commandCommand
createDeleteCommand(java.lang.String key, byte[] keyBytes, int time, long cas, boolean noreply)
create a delete commandCommand
createFlushAllCommand(java.util.concurrent.CountDownLatch latch, int delay, boolean noreply)
create a flush_all commandCommand
createGetAndTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.CountDownLatch latch, int exp, boolean noreply)
Create a get-and-touch commandCommand
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 commandCommand
createIncrDecrCommand(java.lang.String key, byte[] keyBytes, long delta, long initial, int expTime, CommandType cmdType, boolean noreply)
create a incr/decr commandCommand
createPrependCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
Create a prepend commandCommand
createQuitCommand()
create a quit commandCommand
createReplaceCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
create a replace commandCommand
createSetCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
Create a set commandCommand
createStatsCommand(java.net.InetSocketAddress server, java.util.concurrent.CountDownLatch latch, java.lang.String itemName)
create a stats commandCommand
createTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.CountDownLatch latch, int exp, boolean noreply)
Create a touch commandCommand
createVerbosityCommand(java.util.concurrent.CountDownLatch latch, int level, boolean noreply)
Create a verbosity commandCommand
createVersionCommand(java.util.concurrent.CountDownLatch latch, java.net.InetSocketAddress server)
create a version commandProtocol
getProtocol()
Get this client's protocol versionvoid
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, long cas, 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
- TODOcmdBytes
- 命令的字节数组,如"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:
-
createTouchCommand
Command createTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.CountDownLatch latch, int exp, boolean noreply)
Create a touch command- Parameters:
key
-keyBytes
-latch
- TODOexp
-noreply
-- Returns:
- Since:
- 1.3.3
-
createGetAndTouchCommand
Command createGetAndTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.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(java.lang.String subCommand, java.lang.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:
-
-