Package net.rubyeye.xmemcached
Interface CommandFactory
- All Known Implementing Classes:
BinaryCommandFactory
,KestrelCommandFactory
,TextCommandFactory
public interface CommandFactory
-
Method Summary
Modifier and TypeMethodDescriptioncreateAddCommand
(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) create a add commandcreateAppendCommand
(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder) create a append commandCreate a command for listing authentication mechanismscreateAuthStartCommand
(String mechanism, CountDownLatch latch, byte[] authData) Create command for starting authenticationcreateAuthStepCommand
(String mechanism, CountDownLatch latch, byte[] authData) Create a command for stepping authenticationcreateAWSElasticCacheConfigCommand
(String subCommand, String key) Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.createCASCommand
(String key, byte[] keyBytes, int exp, Object value, long cas, boolean noreply, Transcoder transcoder) Create a cas commandcreateDeleteCommand
(String key, byte[] keyBytes, int time, long cas, boolean noreply) create a delete commandcreateFlushAllCommand
(CountDownLatch latch, int delay, boolean noreply) create a flush_all commandcreateGetAndTouchCommand
(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply) Create a get-and-touch commandcreateGetCommand
(String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder) create a get/gets command<T> Command
createGetMultiCommand
(Collection<String> keys, CountDownLatch latch, CommandType cmdType, Transcoder<T> transcoder) Create a multi-get commandcreateIncrDecrCommand
(String key, byte[] keyBytes, long delta, long initial, int expTime, CommandType cmdType, boolean noreply) create a incr/decr commandcreatePrependCommand
(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder) Create a prepend commandcreate a quit commandcreateReplaceCommand
(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) create a replace commandcreateSetCommand
(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) Create a set commandcreateStatsCommand
(InetSocketAddress server, CountDownLatch latch, String itemName) create a stats commandcreateTouchCommand
(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply) Create a touch commandcreateVerbosityCommand
(CountDownLatch latch, int level, boolean noreply) Create a verbosity commandcreateVersionCommand
(CountDownLatch latch, InetSocketAddress server) create a version commandGet this client's protocol versionvoid
setBufferAllocator
(BufferAllocator bufferAllocator) set command factory's buffer allocator
-
Method Details
-
setBufferAllocator
set command factory's buffer allocator- Parameters:
bufferAllocator
-- Since:
- 1.2.0
-
createDeleteCommand
create a delete command- Parameters:
key
-time
-- Returns:
-
createVersionCommand
create a version command- Returns:
-
createFlushAllCommand
create a flush_all command- Returns:
-
createStatsCommand
create a stats command- Returns:
-
createGetCommand
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
-cmdType
-transcoder
-result
-cmdBytes
-- 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
Create a verbosity command- Parameters:
latch
-level
-noreply
-- Returns:
-
createAuthListMechanismsCommand
Create a command for listing authentication mechanisms- Parameters:
latch
-- Returns:
-
createAuthStartCommand
Create command for starting authentication- Parameters:
mechanism
-latch
-authData
-- Returns:
-
createAuthStepCommand
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
Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.- Parameters:
subCommand
-key
-- Returns:
- See Also:
-
getProtocol
Protocol getProtocol()Get this client's protocol version- Returns:
-