Package net.rubyeye.xmemcached.command
Class BinaryCommandFactory
java.lang.Object
net.rubyeye.xmemcached.command.BinaryCommandFactory
- All Implemented Interfaces:
CommandFactory
Binary protocol command factory
- Since:
- 1.2.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
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 amount, 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 command(package private) final Command
createStoreCommand
(String key, byte[] keyBytes, int exp, Object value, CommandType cmdType, boolean noreply, Transcoder transcoder) createTouchCommand
(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
-
Field Details
-
bufferAllocator
-
-
Constructor Details
-
BinaryCommandFactory
public BinaryCommandFactory()
-
-
Method Details
-
createAWSElasticCacheConfigCommand
Description copied from interface:CommandFactory
Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.- Specified by:
createAWSElasticCacheConfigCommand
in interfaceCommandFactory
- Parameters:
subCommand
-key
-- Returns:
- See Also:
-
setBufferAllocator
Description copied from interface:CommandFactory
set command factory's buffer allocator- Specified by:
setBufferAllocator
in interfaceCommandFactory
- Parameters:
bufferAllocator
-
-
createAddCommand
public Command createAddCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) Description copied from interface:CommandFactory
create a add command- Specified by:
createAddCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-exp
-value
-noreply
-transcoder
-- Returns:
-
createAppendCommand
public Command createAppendCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder) Description copied from interface:CommandFactory
create a append command- Specified by:
createAppendCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-value
-noreply
-transcoder
-- Returns:
-
createCASCommand
public Command createCASCommand(String key, byte[] keyBytes, int exp, Object value, long cas, boolean noreply, Transcoder transcoder) Description copied from interface:CommandFactory
Create a cas command- Specified by:
createCASCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-exp
-value
-cas
-noreply
-transcoder
-- Returns:
-
createDeleteCommand
public Command createDeleteCommand(String key, byte[] keyBytes, int time, long cas, boolean noreply) Description copied from interface:CommandFactory
create a delete command- Specified by:
createDeleteCommand
in interfaceCommandFactory
- Parameters:
key
-time
-- Returns:
-
createFlushAllCommand
Description copied from interface:CommandFactory
create a flush_all command- Specified by:
createFlushAllCommand
in interfaceCommandFactory
- Returns:
-
createGetCommand
public Command createGetCommand(String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder) Description copied from interface:CommandFactory
create a get/gets command- Specified by:
createGetCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-cmdType
- 命令类型transcoder
- TODO- Returns:
-
createGetMultiCommand
public <T> Command createGetMultiCommand(Collection<String> keys, CountDownLatch latch, CommandType cmdType, Transcoder<T> transcoder) Description copied from interface:CommandFactory
Create a multi-get command- Specified by:
createGetMultiCommand
in interfaceCommandFactory
- Type Parameters:
T
-- Parameters:
keys
-latch
-cmdType
-transcoder
-- Returns:
-
createIncrDecrCommand
public Command createIncrDecrCommand(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 interfaceCommandFactory
- Parameters:
key
-keyBytes
-amount
-initial
-expTime
-cmdType
-noreply
-- Returns:
-
createPrependCommand
public Command createPrependCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder) Description copied from interface:CommandFactory
Create a prepend command- Specified by:
createPrependCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-value
-noreply
-transcoder
-- Returns:
-
createReplaceCommand
public Command createReplaceCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) Description copied from interface:CommandFactory
create a replace command- Specified by:
createReplaceCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-exp
-value
-noreply
-transcoder
-- Returns:
-
createStoreCommand
final Command createStoreCommand(String key, byte[] keyBytes, int exp, Object value, CommandType cmdType, boolean noreply, Transcoder transcoder) -
createSetCommand
public Command createSetCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) Description copied from interface:CommandFactory
Create a set command- Specified by:
createSetCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-exp
-value
-noreply
-transcoder
-- Returns:
-
createStatsCommand
Description copied from interface:CommandFactory
create a stats command- Specified by:
createStatsCommand
in interfaceCommandFactory
- Returns:
-
createVerbosityCommand
Description copied from interface:CommandFactory
Create a verbosity command- Specified by:
createVerbosityCommand
in interfaceCommandFactory
- Parameters:
latch
-level
-noreply
-- Returns:
-
createVersionCommand
Description copied from interface:CommandFactory
create a version command- Specified by:
createVersionCommand
in interfaceCommandFactory
- Returns:
-
createAuthListMechanismsCommand
Description copied from interface:CommandFactory
Create a command for listing authentication mechanisms- Specified by:
createAuthListMechanismsCommand
in interfaceCommandFactory
- Parameters:
latch
-- Returns:
-
createAuthStartCommand
Description copied from interface:CommandFactory
Create command for starting authentication- Specified by:
createAuthStartCommand
in interfaceCommandFactory
- Parameters:
mechanism
-latch
-authData
-- Returns:
-
createAuthStepCommand
Description copied from interface:CommandFactory
Create a command for stepping authentication- Specified by:
createAuthStepCommand
in interfaceCommandFactory
- Parameters:
mechanism
-latch
-authData
-- Returns:
-
createGetAndTouchCommand
public Command createGetAndTouchCommand(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply) Description copied from interface:CommandFactory
Create a get-and-touch command- Specified by:
createGetAndTouchCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-latch
- TODOexp
-noreply
-- Returns:
-
createTouchCommand
public Command createTouchCommand(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply) Description copied from interface:CommandFactory
Create a touch command- Specified by:
createTouchCommand
in interfaceCommandFactory
- Parameters:
key
-keyBytes
-latch
- TODOexp
-noreply
-- Returns:
-
createQuitCommand
Description copied from interface:CommandFactory
create a quit command- Specified by:
createQuitCommand
in interfaceCommandFactory
- Returns:
-
getProtocol
Description copied from interface:CommandFactory
Get this client's protocol version- Specified by:
getProtocol
in interfaceCommandFactory
- Returns:
-