Package net.rubyeye.xmemcached.command
Class TextCommandFactory
java.lang.Object
net.rubyeye.xmemcached.command.TextCommandFactory
- All Implemented Interfaces:
CommandFactory
Command Factory for creating text protocol commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Command
createAddCommand
(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) create a add commandfinal Command
createAppendCommand
(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.final Command
createCASCommand
(String key, byte[] keyBytes, int exp, Object value, long cas, boolean noreply, Transcoder transcoder) Create a cas commandfinal Command
createDeleteCommand
(String key, byte[] keyBytes, int time, long cas, boolean noreply) create a delete commandfinal Command
createFlushAllCommand
(CountDownLatch latch, int exptime, boolean noreply) create a flush_all commandcreateGetAndTouchCommand
(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply) Create a get-and-touch commandfinal Command
createGetCommand
(String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder) create a get/gets commandfinal <T> Command
createGetMultiCommand
(Collection<String> keys, CountDownLatch latch, CommandType cmdType, Transcoder<T> transcoder) Create a multi-get commandfinal Command
createIncrDecrCommand
(String key, byte[] keyBytes, long amount, long initial, int exptime, CommandType cmdType, boolean noreply) create a incr/decr commandfinal Command
createPrependCommand
(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder) Create a prepend commandcreate a quit commandfinal Command
createReplaceCommand
(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) create a replace commandfinal Command
createSetCommand
(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder) Create a set commandfinal Command
createStatsCachedumpCommand
(InetSocketAddress server, CountDownLatch latch, int slabId, int limit) final Command
createStatsCommand
(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 commandfinal Command
createVerbosityCommand
(CountDownLatch latch, int level, boolean noreply) Create verbosity commandfinal Command
createVersionCommand
(CountDownLatch latch, InetSocketAddress server) create a version commandGet this client's protocol versionvoid
setBufferAllocator
(BufferAllocator bufferAllocator) set command factory's buffer allocator
-
Constructor Details
-
TextCommandFactory
public TextCommandFactory()
-
-
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
-
-
createDeleteCommand
public final 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:
-
createVersionCommand
Description copied from interface:CommandFactory
create a version command- Specified by:
createVersionCommand
in interfaceCommandFactory
- Returns:
-
createFlushAllCommand
Description copied from interface:CommandFactory
create a flush_all command- Specified by:
createFlushAllCommand
in interfaceCommandFactory
- Returns:
-
createVerbosityCommand
Create verbosity command- Specified by:
createVerbosityCommand
in interfaceCommandFactory
- Parameters:
latch
-level
-noreply
-- Returns:
-
createStatsCommand
public final Command createStatsCommand(InetSocketAddress server, CountDownLatch latch, String itemName) Description copied from interface:CommandFactory
create a stats command- Specified by:
createStatsCommand
in interfaceCommandFactory
- Returns:
-
createStatsCachedumpCommand
public final Command createStatsCachedumpCommand(InetSocketAddress server, CountDownLatch latch, int slabId, int limit) -
createCASCommand
public final 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:
-
createSetCommand
public final 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:
-
createAddCommand
public final 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:
-
createReplaceCommand
public final 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:
-
createAppendCommand
public final 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:
-
createPrependCommand
public final 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:
-
createStoreCommand
final Command createStoreCommand(String key, byte[] keyBytes, int exp, Object value, CommandType cmdType, boolean noreply, Transcoder transcoder) -
createGetCommand
public final 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 final <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 final 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:
-
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:
-