Package net.rubyeye.xmemcached.command
Class TextCommandFactory
- java.lang.Object
-
- net.rubyeye.xmemcached.command.TextCommandFactory
-
- All Implemented Interfaces:
CommandFactory
public class TextCommandFactory extends Object implements CommandFactory
Command Factory for creating text protocol commands.- Author:
- dennis
-
-
Constructor Summary
Constructors Constructor Description TextCommandFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandcreateAddCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder)create a add commandCommandcreateAppendCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder)create a append commandCommandcreateAuthListMechanismsCommand(CountDownLatch latch)Create a command for listing authentication mechanismsCommandcreateAuthStartCommand(String mechanism, CountDownLatch latch, byte[] authData)Create command for starting authenticationCommandcreateAuthStepCommand(String mechanism, CountDownLatch latch, byte[] authData)Create a command for stepping authenticationCommandcreateAWSElasticCacheConfigCommand(String subCommand, String key)Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.CommandcreateCASCommand(String key, byte[] keyBytes, int exp, Object value, long cas, boolean noreply, Transcoder transcoder)Create a cas commandCommandcreateDeleteCommand(String key, byte[] keyBytes, int time, long cas, boolean noreply)create a delete commandCommandcreateFlushAllCommand(CountDownLatch latch, int exptime, boolean noreply)create a flush_all commandCommandcreateGetAndTouchCommand(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply)Create a get-and-touch commandCommandcreateGetCommand(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 commandCommandcreateIncrDecrCommand(String key, byte[] keyBytes, long amount, long initial, int exptime, CommandType cmdType, boolean noreply)create a incr/decr commandCommandcreatePrependCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder)Create a prepend commandCommandcreateQuitCommand()create a quit commandCommandcreateReplaceCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder)create a replace commandCommandcreateSetCommand(String key, byte[] keyBytes, int exp, Object value, boolean noreply, Transcoder transcoder)Create a set commandCommandcreateStatsCachedumpCommand(InetSocketAddress server, CountDownLatch latch, int slabId, int limit)CommandcreateStatsCommand(InetSocketAddress server, CountDownLatch latch, String itemName)create a stats commandCommandcreateTouchCommand(String key, byte[] keyBytes, CountDownLatch latch, int exp, boolean noreply)Create a touch commandCommandcreateVerbosityCommand(CountDownLatch latch, int level, boolean noreply)Create verbosity commandCommandcreateVersionCommand(CountDownLatch latch, InetSocketAddress server)create a version commandProtocolgetProtocol()Get this client's protocol versionvoidsetBufferAllocator(BufferAllocator bufferAllocator)set command factory's buffer allocator
-
-
-
Method Detail
-
createAWSElasticCacheConfigCommand
public Command createAWSElasticCacheConfigCommand(String subCommand, String key)
Description copied from interface:CommandFactoryCreate a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.- Specified by:
createAWSElasticCacheConfigCommandin interfaceCommandFactory- Returns:
- See Also:
- Adding Auto Discovery To Your Client Library
-
setBufferAllocator
public void setBufferAllocator(BufferAllocator bufferAllocator)
Description copied from interface:CommandFactoryset command factory's buffer allocator- Specified by:
setBufferAllocatorin interfaceCommandFactory
-
createDeleteCommand
public final Command createDeleteCommand(String key, byte[] keyBytes, int time, long cas, boolean noreply)
Description copied from interface:CommandFactorycreate a delete command- Specified by:
createDeleteCommandin interfaceCommandFactory- Returns:
-
createVersionCommand
public final Command createVersionCommand(CountDownLatch latch, InetSocketAddress server)
Description copied from interface:CommandFactorycreate a version command- Specified by:
createVersionCommandin interfaceCommandFactory- Returns:
-
createFlushAllCommand
public final Command createFlushAllCommand(CountDownLatch latch, int exptime, boolean noreply)
Description copied from interface:CommandFactorycreate a flush_all command- Specified by:
createFlushAllCommandin interfaceCommandFactory- Returns:
-
createVerbosityCommand
public final Command createVerbosityCommand(CountDownLatch latch, int level, boolean noreply)
Create verbosity command- Specified by:
createVerbosityCommandin interfaceCommandFactory- Parameters:
latch-level-noreply-- Returns:
-
createStatsCommand
public final Command createStatsCommand(InetSocketAddress server, CountDownLatch latch, String itemName)
Description copied from interface:CommandFactorycreate a stats command- Specified by:
createStatsCommandin 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:CommandFactoryCreate a cas command- Specified by:
createCASCommandin interfaceCommandFactory- Returns:
-
createSetCommand
public final 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- Returns:
-
createAddCommand
public final 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- Returns:
-
createReplaceCommand
public final 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- Returns:
-
createAppendCommand
public final Command createAppendCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactorycreate a append command- Specified by:
createAppendCommandin interfaceCommandFactory- Returns:
-
createPrependCommand
public final Command createPrependCommand(String key, byte[] keyBytes, Object value, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactoryCreate a prepend command- Specified by:
createPrependCommandin interfaceCommandFactory- Returns:
-
createGetCommand
public final Command createGetCommand(String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder)
Description copied from interface:CommandFactorycreate a get/gets command- Specified by:
createGetCommandin interfaceCommandFactorycmdType- 命令类型transcoder- TODO- Returns:
-
createGetMultiCommand
public final <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- Returns:
-
createIncrDecrCommand
public final 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- Returns:
-
createAuthListMechanismsCommand
public Command createAuthListMechanismsCommand(CountDownLatch latch)
Description copied from interface:CommandFactoryCreate a command for listing authentication mechanisms- Specified by:
createAuthListMechanismsCommandin interfaceCommandFactory- Returns:
-
createAuthStartCommand
public Command createAuthStartCommand(String mechanism, CountDownLatch latch, byte[] authData)
Description copied from interface:CommandFactoryCreate command for starting authentication- Specified by:
createAuthStartCommandin interfaceCommandFactory- Returns:
-
createAuthStepCommand
public Command createAuthStepCommand(String mechanism, CountDownLatch latch, byte[] authData)
Description copied from interface:CommandFactoryCreate a command for stepping authentication- Specified by:
createAuthStepCommandin interfaceCommandFactory- 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 interfaceCommandFactorylatch- TODO- 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 interfaceCommandFactorylatch- TODO- Returns:
-
createQuitCommand
public Command createQuitCommand()
Description copied from interface:CommandFactorycreate a quit command- Specified by:
createQuitCommandin interfaceCommandFactory- Returns:
-
getProtocol
public Protocol getProtocol()
Description copied from interface:CommandFactoryGet this client's protocol version- Specified by:
getProtocolin interfaceCommandFactory- Returns:
-
-