Class BinaryOperationFactory
java.lang.Object
net.spy.memcached.ops.BaseOperationFactory
net.spy.memcached.protocol.binary.BinaryOperationFactory
- All Implemented Interfaces:
OperationFactory
Factory for binary operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncas(StoreType type, String key, long casId, int flags, int exp, byte[] data, StoreOperation.Callback cb) Create a CAS operation.cat(ConcatenationType catType, long casId, String key, byte[] data, OperationCallback cb) Get a concatenation operation.protected Collection<? extends Operation> delete(String key, long cas, DeleteOperation.Callback operationCallback) Create a deletion operation with CAS.delete(String key, DeleteOperation.Callback operationCallback) Create a deletion operation.deleteConfig(ConfigurationType type, OperationCallback cb) Create a deletion operation for config.flush(int delay, OperationCallback cb) Create a flush operation.get(String key, GetOperation.Callback callback) Create a get operation.get(Collection<String> value, GetOperation.Callback cb) Create a get operation.getAndTouch(String key, int expiration, GetAndTouchOperation.Callback cb) Gets the value of a key and resets its timeout.getConfig(ConfigurationType type, GetConfigOperation.Callback callback) Create a getConfig operation.getl(String key, int exp, GetlOperation.Callback cb) Create a getl operation.gets(String key, GetsOperation.Callback cb) Create a gets operation.keyStats(String key, StatsOperation.Callback cb) Get a new KeyStatsOperation.mutate(Mutator m, String key, long by, long def, int exp, OperationCallback cb) Create a mutator operation.Create a NOOP operation.observe(String key, long casId, int index, ObserveOperation.Callback cb) Create an Observe operation.Refresh the TLS certificatereplicaGet(String key, int index, ReplicaGetOperation.Callback callback) Create a replica get operation.replicaGets(String key, int index, ReplicaGetsOperation.Callback callback) Create a replica gets operation.saslAuth(SaslClient sc, OperationCallback cb) Create a new sasl auth operation.Create a new SASL mechs operation.saslStep(SaslClient sc, byte[] ch, OperationCallback cb) Create a new sasl step operation.setConfig(ConfigurationType type, int flags, byte[] data, OperationCallback cb) Create a setConfig operation.stats(String arg, StatsOperation.Callback cb) Get a new StatsOperation.store(StoreType storeType, String key, int flags, int exp, byte[] data, StoreOperation.Callback cb) Create a store operation.tapAck(TapOpcode opcode, int opaque, OperationCallback cb) Sends a tap ack message to the server.tapBackfill(String id, long date, OperationCallback cb) Creates a tap backfill stream.tapCustom(String id, RequestMessage message, OperationCallback cb) Creates a custom tap stream.tapDump(String id, OperationCallback cb) Sends a tap dump message to the server.touch(String key, int expiration, OperationCallback cb) Resets a keys expiration time.unlock(String key, long casId, OperationCallback cb) Create a Unlock operation.Create a new version operation.Methods inherited from class net.spy.memcached.ops.BaseOperationFactory
clone
-
Constructor Details
-
BinaryOperationFactory
public BinaryOperationFactory()
-
-
Method Details
-
delete
Description copied from interface:OperationFactoryCreate a deletion operation.- Parameters:
key- the key to deleteoperationCallback- the status callback- Returns:
- the new DeleteOperation
-
delete
Description copied from interface:OperationFactoryCreate a deletion operation with CAS.- Parameters:
key- the key to deletecas- the CAS value to pass alongoperationCallback- the status callback- Returns:
- the new DeleteOperation
-
unlock
Description copied from interface:OperationFactoryCreate a Unlock operation.- Parameters:
key- the key to unlockcasId- the value of CAScb- the status callback- Returns:
- the new UnlockOperation
-
observe
Description copied from interface:OperationFactoryCreate an Observe operation.- Parameters:
key- the key to observecasId- the value of CASindex- the VBucket index of keycb- the status callback- Returns:
- the new ObserveOperation
-
flush
Description copied from interface:OperationFactoryCreate a flush operation.- Parameters:
delay- delay until flush.cb- the status callback- Returns:
- the new FlushOperation
-
getAndTouch
public GetAndTouchOperation getAndTouch(String key, int expiration, GetAndTouchOperation.Callback cb) Description copied from interface:OperationFactoryGets the value of a key and resets its timeout.- Parameters:
key- the key to get a value for and reset its timeoutexpiration- the new expiration for the keycb- the callback that will contain the result- Returns:
- a new GATOperation
-
get
Description copied from interface:OperationFactoryCreate a get operation.- Parameters:
key- the key to getcallback- the callback that will contain the results- Returns:
- a new GetOperation
-
replicaGet
Description copied from interface:OperationFactoryCreate a replica get operation.- Parameters:
key- the key to getcallback- the callback that will contain the results- Returns:
- a new ReplicaGetOperation
-
replicaGets
public ReplicaGetsOperation replicaGets(String key, int index, ReplicaGetsOperation.Callback callback) Description copied from interface:OperationFactoryCreate a replica gets operation.- Parameters:
key- the key to getcallback- the callback that will contain the results- Returns:
- a new ReplicaGetOperation
-
get
Description copied from interface:OperationFactoryCreate a get operation.- Parameters:
value- the collection of keys to getcb- the callback that will contain the results- Returns:
- a new GetOperation
-
getl
Description copied from interface:OperationFactoryCreate a getl operation. A getl gets the value for a key and then locks the value for a given amount of time. The maximum default lock time is 30 seconds.- Parameters:
key- the key to get and lockexp- the amount of time the lock should be valid for in seconds.cb- the callback that will contain the results- Returns:
- a new GetOperation
-
gets
Description copied from interface:OperationFactoryCreate a gets operation.- Parameters:
key- the key to getcb- the callback that will contain the results- Returns:
- a new GetsOperation
-
keyStats
Description copied from interface:OperationFactoryGet a new KeyStatsOperation.- Parameters:
key- the key to get stats forcb- the stats callback- Returns:
- the new StatsOperation
-
getConfig
Description copied from interface:OperationFactoryCreate a getConfig operation.- Parameters:
type- the config type to getcallback- the callback that will contain the results- Returns:
- a new GetConfigOperation
-
setConfig
public SetConfigOperation setConfig(ConfigurationType type, int flags, byte[] data, OperationCallback cb) Description copied from interface:OperationFactoryCreate a setConfig operation.- Parameters:
type- the config type to setflags- the config flagsdata- the datacb- the status callback- Returns:
- a new SetConfigOperation
-
deleteConfig
Description copied from interface:OperationFactoryCreate a deletion operation for config.- Parameters:
type- the configuration type to deletecb- the status callback- Returns:
- the new DeleteConfigOperation
-
mutate
public MutatorOperation mutate(Mutator m, String key, long by, long def, int exp, OperationCallback cb) Description copied from interface:OperationFactoryCreate a mutator operation.- Parameters:
m- the mutator typekey- the mutatee keyby- the amount to increment or decrementdef- the default valueexp- expiration in case we need to default (0 if no default)cb- the status callback- Returns:
- the new mutator operation
-
stats
Description copied from interface:OperationFactoryGet a new StatsOperation.- Parameters:
arg- the stat parameter (see protocol docs)cb- the stats callback- Returns:
- the new StatsOperation
-
store
public StoreOperation store(StoreType storeType, String key, int flags, int exp, byte[] data, StoreOperation.Callback cb) Description copied from interface:OperationFactoryCreate a store operation.- Parameters:
storeType- the type of store operationkey- the key to storeflags- the storage flagsexp- the expiration timedata- the datacb- the status callback- Returns:
- the new store operation
-
touch
Description copied from interface:OperationFactoryResets a keys expiration time.- Parameters:
key- The key whose expiration time is to be reset.expiration- The new expiration time for the keycb- The status callback- Returns:
- A touch operation
-
refreshCertificate
Description copied from interface:OperationFactoryRefresh the TLS certificate- Parameters:
cb- The status callback- Returns:
- A TLS certificate refresh operation
-
version
Description copied from interface:OperationFactoryCreate a new version operation. -
noop
Description copied from interface:OperationFactoryCreate a NOOP operation.- Parameters:
cb- the operation callback- Returns:
- the new NoopOperation
-
cas
public CASOperation cas(StoreType type, String key, long casId, int flags, int exp, byte[] data, StoreOperation.Callback cb) Description copied from interface:OperationFactoryCreate a CAS operation.- Parameters:
key- the key to storecasId- the CAS identifier value (from a gets operation)flags- the storage flagsexp- the expiration timedata- the datacb- the status callback- Returns:
- the new store operation
-
cat
public ConcatenationOperation cat(ConcatenationType catType, long casId, String key, byte[] data, OperationCallback cb) Description copied from interface:OperationFactoryGet a concatenation operation.- Parameters:
catType- the type of concatenation to perform.casId- the CAS value for an atomic compare-and-catkey- the keydata- the data to storecb- a callback for reporting the status- Returns:
- thew new ConcatenationOperation
-
cloneGet
- Specified by:
cloneGetin classBaseOperationFactory
-
saslAuth
Description copied from interface:OperationFactoryCreate a new sasl auth operation. -
saslMechs
Description copied from interface:OperationFactoryCreate a new SASL mechs operation. -
saslStep
Description copied from interface:OperationFactoryCreate a new sasl step operation. -
tapBackfill
Description copied from interface:OperationFactoryCreates a tap backfill stream. See http://www.couchbase.org/wiki/display/membase/TAP+Protocol for more details on the tap protocol. TAP connection names are optional, but allow for momentary interruptions in connection to automatically restart. TAP connection names also appear in TAP stats from the given server. Note that according to the protocol, TAP backfill dates are advisory and the protocol guarantees at least data from specified date forward, but earlier mutations may be received.- Parameters:
id- The name for the TAP connectiondate- The date to start backfill from.cb- The status callback.- Returns:
- The tap operation used to create and handle the stream.
-
tapCustom
Description copied from interface:OperationFactoryCreates a custom tap stream. See http://www.couchbase.org/wiki/display/membase/TAP+Protocol for more details on the tap protocol. TAP connection names are optional, but allow for momentary interruptions in connection to automatically restart. TAP connection names also appear in TAP stats from the given server.- Parameters:
id- The name for the TAP connectionmessage- The tap message to send.cb- The status callback.- Returns:
- The tap operation used to create and handle the stream.
-
tapAck
Description copied from interface:OperationFactorySends a tap ack message to the server. See http://www.couchbase.org/wiki/display/membase/TAP+Protocol for more details on the tap protocol.- Parameters:
opcode- the opcode sent to the client by the server.opaque- the opaque value sent to the client by the server.cb- the callback for the tap stream.- Returns:
- a tap ack operation.
-
tapDump
Description copied from interface:OperationFactorySends a tap dump message to the server. See http://www.couchbase.org/wiki/display/membase/TAP+Protocol for more details on the tap protocol.- Parameters:
id- the name for the TAP connectioncb- the callback for the tap stream.- Returns:
- a tap dump operation.
-