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> CommandcreateGetMultiCommand(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 CommandcreateStoreCommand(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 versionvoidsetBufferAllocator(BufferAllocator bufferAllocator) set command factory's buffer allocator
-
Field Details
-
bufferAllocator
-
-
Constructor Details
-
BinaryCommandFactory
public BinaryCommandFactory()
-
-
Method Details
-
createAWSElasticCacheConfigCommand
Description copied from interface:CommandFactoryCreate a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.- Specified by:
createAWSElasticCacheConfigCommandin interfaceCommandFactory- Parameters:
subCommand-key-- Returns:
- See Also:
-
setBufferAllocator
Description copied from interface:CommandFactoryset command factory's buffer allocator- Specified by:
setBufferAllocatorin interfaceCommandFactory- Parameters:
bufferAllocator-
-
createAddCommand
public Command createAddCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) Description copied from interface:CommandFactorycreate a add command- Specified by:
createAddCommandin 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:CommandFactorycreate a append command- Specified by:
createAppendCommandin 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:CommandFactoryCreate a cas command- Specified by:
createCASCommandin 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:CommandFactorycreate a delete command- Specified by:
createDeleteCommandin interfaceCommandFactory- Parameters:
key-time-- Returns:
-
createFlushAllCommand
Description copied from interface:CommandFactorycreate a flush_all command- Specified by:
createFlushAllCommandin interfaceCommandFactory- Returns:
-
createGetCommand
public Command createGetCommand(String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder) Description copied from interface:CommandFactorycreate a get/gets command- Specified by:
createGetCommandin 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:CommandFactoryCreate a multi-get command- Specified by:
createGetMultiCommandin 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:CommandFactorycreate a incr/decr command- Specified by:
createIncrDecrCommandin 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:CommandFactoryCreate a prepend command- Specified by:
createPrependCommandin 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:CommandFactorycreate a replace command- Specified by:
createReplaceCommandin 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:CommandFactoryCreate a set command- Specified by:
createSetCommandin interfaceCommandFactory- Parameters:
key-keyBytes-exp-value-noreply-transcoder-- Returns:
-
createStatsCommand
Description copied from interface:CommandFactorycreate a stats command- Specified by:
createStatsCommandin interfaceCommandFactory- Returns:
-
createVerbosityCommand
Description copied from interface:CommandFactoryCreate a verbosity command- Specified by:
createVerbosityCommandin interfaceCommandFactory- Parameters:
latch-level-noreply-- Returns:
-
createVersionCommand
Description copied from interface:CommandFactorycreate a version command- Specified by:
createVersionCommandin interfaceCommandFactory- Returns:
-
createAuthListMechanismsCommand
Description copied from interface:CommandFactoryCreate a command for listing authentication mechanisms- Specified by:
createAuthListMechanismsCommandin interfaceCommandFactory- Parameters:
latch-- Returns:
-
createAuthStartCommand
Description copied from interface:CommandFactoryCreate command for starting authentication- Specified by:
createAuthStartCommandin interfaceCommandFactory- Parameters:
mechanism-latch-authData-- Returns:
-
createAuthStepCommand
Description copied from interface:CommandFactoryCreate a command for stepping authentication- Specified by:
createAuthStepCommandin interfaceCommandFactory- Parameters:
mechanism-latch-authData-- Returns:
-
createGetAndTouchCommand
public Command createGetAndTouchCommand(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply) Description copied from interface:CommandFactoryCreate a get-and-touch command- Specified by:
createGetAndTouchCommandin 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:CommandFactoryCreate a touch command- Specified by:
createTouchCommandin interfaceCommandFactory- Parameters:
key-keyBytes-latch- TODOexp-noreply-- Returns:
-
createQuitCommand
Description copied from interface:CommandFactorycreate a quit command- Specified by:
createQuitCommandin interfaceCommandFactory- Returns:
-
getProtocol
Description copied from interface:CommandFactoryGet this client's protocol version- Specified by:
getProtocolin interfaceCommandFactory- Returns:
-