public interface OperationFactory
Modifier and Type | Method and Description |
---|---|
CASOperation |
cas(StoreType t,
java.lang.String key,
long casId,
int flags,
int exp,
byte[] data,
StoreOperation.Callback cb)
Create a CAS operation.
|
ConcatenationOperation |
cat(ConcatenationType catType,
long casId,
java.lang.String key,
byte[] data,
OperationCallback cb)
Get a concatenation operation.
|
java.util.Collection<Operation> |
clone(KeyedOperation op)
Clone an operation.
|
DeleteOperation |
delete(java.lang.String key,
DeleteOperation.Callback callback)
Create a deletion operation.
|
DeleteOperation |
delete(java.lang.String key,
long cas,
DeleteOperation.Callback callback)
Create a deletion operation with CAS.
|
FlushOperation |
flush(int delay,
OperationCallback operationCallback)
Create a flush operation.
|
GetOperation |
get(java.util.Collection<java.lang.String> keys,
GetOperation.Callback cb)
Create a get operation.
|
GetOperation |
get(java.lang.String key,
GetOperation.Callback callback)
Create a get operation.
|
GetAndTouchOperation |
getAndTouch(java.lang.String key,
int expiration,
GetAndTouchOperation.Callback cb)
Gets the value of a key and resets its timeout.
|
GetlOperation |
getl(java.lang.String key,
int exp,
GetlOperation.Callback callback)
Create a getl operation.
|
GetsOperation |
gets(java.lang.String key,
GetsOperation.Callback callback)
Create a gets operation.
|
StatsOperation |
keyStats(java.lang.String key,
StatsOperation.Callback cb)
Get a new KeyStatsOperation.
|
MutatorOperation |
mutate(Mutator m,
java.lang.String key,
long by,
long def,
int exp,
OperationCallback cb)
Create a mutator operation.
|
NoopOperation |
noop(OperationCallback cb)
Create a NOOP operation.
|
ObserveOperation |
observe(java.lang.String key,
long casId,
int index,
ObserveOperation.Callback operationCallback)
Create an Observe operation.
|
ReplicaGetOperation |
replicaGet(java.lang.String key,
int index,
ReplicaGetOperation.Callback callback)
Create a replica get operation.
|
SASLAuthOperation |
saslAuth(java.lang.String[] mech,
java.lang.String serverName,
java.util.Map<java.lang.String,?> props,
javax.security.auth.callback.CallbackHandler cbh,
OperationCallback cb)
Create a new sasl auth operation.
|
SASLMechsOperation |
saslMechs(OperationCallback cb)
Create a new SASL mechs operation.
|
SASLStepOperation |
saslStep(java.lang.String[] mech,
byte[] challenge,
java.lang.String serverName,
java.util.Map<java.lang.String,?> props,
javax.security.auth.callback.CallbackHandler cbh,
OperationCallback cb)
Create a new sasl step operation.
|
StatsOperation |
stats(java.lang.String arg,
StatsOperation.Callback cb)
Get a new StatsOperation.
|
StoreOperation |
store(StoreType storeType,
java.lang.String key,
int flags,
int exp,
byte[] data,
StoreOperation.Callback cb)
Create a store operation.
|
TapOperation |
tapAck(TapOpcode opcode,
int opaque,
OperationCallback cb)
Sends a tap ack message to the server.
|
TapOperation |
tapBackfill(java.lang.String id,
long date,
OperationCallback cb)
Creates a tap backfill stream.
|
TapOperation |
tapCustom(java.lang.String id,
RequestMessage message,
OperationCallback cb)
Creates a custom tap stream.
|
TapOperation |
tapDump(java.lang.String id,
OperationCallback cb)
Sends a tap dump message to the server.
|
KeyedOperation |
touch(java.lang.String key,
int expiration,
OperationCallback cb)
Resets a keys expiration time.
|
UnlockOperation |
unlock(java.lang.String key,
long casId,
OperationCallback operationCallback)
Create a Unlock operation.
|
VersionOperation |
version(OperationCallback cb)
Create a new version operation.
|
NoopOperation noop(OperationCallback cb)
cb
- the operation callbackDeleteOperation delete(java.lang.String key, DeleteOperation.Callback callback)
key
- the key to deletecallback
- the status callbackDeleteOperation delete(java.lang.String key, long cas, DeleteOperation.Callback callback)
key
- the key to deletecas
- the CAS value to pass alongcallback
- the status callbackUnlockOperation unlock(java.lang.String key, long casId, OperationCallback operationCallback)
key
- the key to unlockcasId
- the value of CASoperationCallback
- the status callbackObserveOperation observe(java.lang.String key, long casId, int index, ObserveOperation.Callback operationCallback)
key
- the key to observecasId
- the value of CASindex
- the VBucket index of keyoperationCallback
- the status callbackFlushOperation flush(int delay, OperationCallback operationCallback)
delay
- delay until flush.operationCallback
- the status callbackGetAndTouchOperation getAndTouch(java.lang.String key, int expiration, GetAndTouchOperation.Callback cb)
key
- the key to get a value for and reset its timeoutexpiration
- the new expiration for the keycb
- the callback that will contain the resultGetOperation get(java.lang.String key, GetOperation.Callback callback)
key
- the key to getcallback
- the callback that will contain the resultsReplicaGetOperation replicaGet(java.lang.String key, int index, ReplicaGetOperation.Callback callback)
key
- the key to getcallback
- the callback that will contain the resultsGetlOperation getl(java.lang.String key, int exp, GetlOperation.Callback callback)
key
- the key to get and lockexp
- the amount of time the lock should be valid for in seconds.callback
- the callback that will contain the resultsGetsOperation gets(java.lang.String key, GetsOperation.Callback callback)
key
- the key to getcallback
- the callback that will contain the resultsGetOperation get(java.util.Collection<java.lang.String> keys, GetOperation.Callback cb)
keys
- the collection of keys to getcb
- the callback that will contain the resultsStatsOperation keyStats(java.lang.String key, StatsOperation.Callback cb)
key
- the key to get stats forcb
- the stats callbackMutatorOperation mutate(Mutator m, java.lang.String key, long by, long def, int exp, OperationCallback cb)
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 callbackStatsOperation stats(java.lang.String arg, StatsOperation.Callback cb)
arg
- the stat parameter (see protocol docs)cb
- the stats callbackStoreOperation store(StoreType storeType, java.lang.String key, int flags, int exp, byte[] data, StoreOperation.Callback cb)
storeType
- the type of store operationkey
- the key to storeflags
- the storage flagsexp
- the expiration timedata
- the datacb
- the status callbackKeyedOperation touch(java.lang.String key, int expiration, OperationCallback cb)
key
- The key whose expiration time is to be reset.expiration
- The new expiration time for the keycb
- The status callbackConcatenationOperation cat(ConcatenationType catType, long casId, java.lang.String key, byte[] data, OperationCallback cb)
catType
- the type of concatenation to perform.key
- the keycasId
- the CAS value for an atomic compare-and-catdata
- the data to storecb
- a callback for reporting the statusCASOperation cas(StoreType t, java.lang.String key, long casId, int flags, int exp, byte[] data, StoreOperation.Callback cb)
key
- the key to storecasId
- the CAS identifier value (from a gets operation)flags
- the storage flagsexp
- the expiration timedata
- the datacb
- the status callbackVersionOperation version(OperationCallback cb)
SASLMechsOperation saslMechs(OperationCallback cb)
SASLAuthOperation saslAuth(java.lang.String[] mech, java.lang.String serverName, java.util.Map<java.lang.String,?> props, javax.security.auth.callback.CallbackHandler cbh, OperationCallback cb)
SASLStepOperation saslStep(java.lang.String[] mech, byte[] challenge, java.lang.String serverName, java.util.Map<java.lang.String,?> props, javax.security.auth.callback.CallbackHandler cbh, OperationCallback cb)
java.util.Collection<Operation> clone(KeyedOperation op)
This is used for requeueing operations after a server is found to be down.
Note that it returns more than one operation because a multi-get could potentially need to be played against a large number of underlying servers. In this case, there's a separate operation for each, and callback fa?ade to reassemble them. It is left up to the operation pipeline to perform whatever optimization is required to turn these back into multi-gets.
op
- the operation to cloneTapOperation tapBackfill(java.lang.String id, long date, OperationCallback cb)
id
- The name for the TAP connectiondate
- The date to start backfill from.cb
- The status callback.TapOperation tapCustom(java.lang.String id, RequestMessage message, OperationCallback cb)
id
- The name for the TAP connectionmessage
- The tap message to send.cb
- The status callback.TapOperation tapAck(TapOpcode opcode, int opaque, OperationCallback cb)
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.TapOperation tapDump(java.lang.String id, OperationCallback cb)
id
- the name for the TAP connectioncb
- the callback for the tap stream.Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.