public class BufferedMorphiumWriterImpl extends Object implements MorphiumWriter, ShutdownListener
| Constructor and Description |
|---|
BufferedMorphiumWriterImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToWriteQueue(Class<?> type,
de.caluga.morphium.writer.BufferedMorphiumWriterImpl.BufferedBulkOp r,
AsyncOperationCallback c,
AsyncOperationType t) |
<T> void |
dropCollection(Class<T> cls,
String collection,
AsyncOperationCallback<T> c) |
<T> void |
ensureIndex(Class<T> cls,
String collection,
Map<String,Object> index,
AsyncOperationCallback<T> c) |
<T> void |
ensureIndex(Class<T> cls,
String collection,
Map<String,Object> index,
Map<String,Object> options,
AsyncOperationCallback<T> c) |
protected void |
finalize() |
void |
flush() |
<T> void |
inc(Query<T> query,
Map<String,Number> fieldsToInc,
boolean insertIfNotExist,
boolean multiple,
AsyncOperationCallback<T> c) |
<T> void |
inc(Query<T> query,
String field,
Number amount,
boolean insertIfNotExist,
boolean multiple,
AsyncOperationCallback<T> c) |
<T> void |
inc(T obj,
String collection,
String field,
Number amount,
AsyncOperationCallback<T> c)
Increases a value in an existing mongo collection entry - no reading necessary.
|
boolean |
isOrderedExecution() |
void |
onShutdown(Morphium m) |
<T> void |
pop(T obj,
String collection,
String field,
boolean first,
AsyncOperationCallback<T> c) |
<T> void |
pushPull(boolean push,
Query<T> q,
String field,
Object value,
boolean insertIfNotExist,
boolean multiple,
AsyncOperationCallback<T> c) |
<T> void |
pushPullAll(boolean push,
Query<T> q,
String field,
List<?> value,
boolean insertIfNotExist,
boolean multiple,
AsyncOperationCallback<T> c) |
<T> void |
remove(List<T> lst,
AsyncOperationCallback<T> c) |
<T> void |
remove(Query<T> q,
AsyncOperationCallback<T> c)
deletes all objects matching the given query
|
<T> void |
remove(T o,
String collection,
AsyncOperationCallback<T> c) |
<T> void |
set(Query<T> query,
Map<String,Object> values,
boolean insertIfNotExist,
boolean multiple,
AsyncOperationCallback<T> c)
will change an entry in mongodb-collection corresponding to given class object
if query is too complex, upsert might not work!
|
<T> void |
set(T toSet,
String collection,
String field,
Object value,
boolean insertIfNotExists,
boolean multiple,
AsyncOperationCallback<T> c)
changes an object in DB AND in Memory...
|
void |
setMaximumQueingTries(int n) |
void |
setMorphium(Morphium m) |
void |
setOrderedExecution(boolean orderedExecution) |
void |
setPauseBetweenTries(int p) |
<T> void |
store(List<T> lst,
AsyncOperationCallback<T> c)
stores the given list of objects, should be entities or embedded.
|
<T> void |
store(List<T> lst,
String collectionName,
AsyncOperationCallback<T> c) |
<T> void |
store(T o,
String collection,
AsyncOperationCallback<T> c)
Stores the object, should be an entity
|
<T> void |
unset(Query<T> query,
AsyncOperationCallback<T> c,
boolean multiple,
Enum... fields) |
<T> void |
unset(Query<T> query,
AsyncOperationCallback<T> c,
boolean multiple,
String... fields) |
<T> void |
unset(Query<T> query,
String field,
boolean multiple,
AsyncOperationCallback<T> c) |
<T> void |
unset(T obj,
String collection,
String field,
AsyncOperationCallback<T> c)
Un-setting a value in an existing mongo collection entry - no reading necessary.
|
<T> void |
updateUsingFields(T ent,
String collection,
AsyncOperationCallback<T> c,
String... fields)
update an object using fields specified
|
int |
writeBufferCount() |
public boolean isOrderedExecution()
public void setOrderedExecution(boolean orderedExecution)
public void addToWriteQueue(Class<?> type, de.caluga.morphium.writer.BufferedMorphiumWriterImpl.BufferedBulkOp r, AsyncOperationCallback c, AsyncOperationType t)
public <T> void store(T o,
String collection,
AsyncOperationCallback<T> c)
MorphiumWriterstore in interface MorphiumWritero - - entitypublic <T> void store(List<T> lst, AsyncOperationCallback<T> c)
MorphiumWriterstore in interface MorphiumWriterlst - - to storepublic <T> void updateUsingFields(T ent,
String collection,
AsyncOperationCallback<T> c,
String... fields)
MorphiumWriterupdateUsingFields in interface MorphiumWriterent - entityfields - - fieldspublic <T> void set(T toSet,
String collection,
String field,
Object value,
boolean insertIfNotExists,
boolean multiple,
AsyncOperationCallback<T> c)
MorphiumWriterset in interface MorphiumWritertoSet - entity to set values in both in mongo and in memoryfield - fieldvalue - value to setpublic <T> void set(Query<T> query, Map<String,Object> values, boolean insertIfNotExist, boolean multiple, AsyncOperationCallback<T> c)
MorphiumWriterset in interface MorphiumWriterquery - - query to specify which objects should be setvalues - - map fieldName->Value, which values are to be set!insertIfNotExist - - insert, if it does not exist (query needs to be simple!)multiple - - update several documents, if false, only first hit will be updatedpublic <T> void inc(Query<T> query, Map<String,Number> fieldsToInc, boolean insertIfNotExist, boolean multiple, AsyncOperationCallback<T> c)
inc in interface MorphiumWriterpublic <T> void inc(Query<T> query, String field, Number amount, boolean insertIfNotExist, boolean multiple, AsyncOperationCallback<T> c)
inc in interface MorphiumWriterpublic <T> void inc(T obj,
String collection,
String field,
Number amount,
AsyncOperationCallback<T> c)
MorphiumWriterinc in interface MorphiumWriterpublic <T> void pop(T obj,
String collection,
String field,
boolean first,
AsyncOperationCallback<T> c)
pop in interface MorphiumWriterpublic void setMorphium(Morphium m)
setMorphium in interface MorphiumWriterpublic <T> void remove(List<T> lst, AsyncOperationCallback<T> c)
remove in interface MorphiumWriterpublic <T> void remove(T o,
String collection,
AsyncOperationCallback<T> c)
remove in interface MorphiumWriterpublic <T> void remove(Query<T> q, AsyncOperationCallback<T> c)
MorphiumWriterremove in interface MorphiumWriterq - the querypublic <T> void pushPull(boolean push,
Query<T> q,
String field,
Object value,
boolean insertIfNotExist,
boolean multiple,
AsyncOperationCallback<T> c)
pushPull in interface MorphiumWriterpublic <T> void pushPullAll(boolean push,
Query<T> q,
String field,
List<?> value,
boolean insertIfNotExist,
boolean multiple,
AsyncOperationCallback<T> c)
pushPullAll in interface MorphiumWriterpublic <T> void unset(T obj,
String collection,
String field,
AsyncOperationCallback<T> c)
MorphiumWriterunset in interface MorphiumWriterpublic <T> void unset(Query<T> query, String field, boolean multiple, AsyncOperationCallback<T> c)
unset in interface MorphiumWriterpublic <T> void unset(Query<T> query, AsyncOperationCallback<T> c, boolean multiple, String... fields)
unset in interface MorphiumWriterpublic <T> void unset(Query<T> query, AsyncOperationCallback<T> c, boolean multiple, Enum... fields)
unset in interface MorphiumWriterpublic <T> void dropCollection(Class<T> cls, String collection, AsyncOperationCallback<T> c)
dropCollection in interface MorphiumWriterpublic <T> void ensureIndex(Class<T> cls, String collection, Map<String,Object> index, AsyncOperationCallback<T> c)
public <T> void ensureIndex(Class<T> cls, String collection, Map<String,Object> index, Map<String,Object> options, AsyncOperationCallback<T> c)
ensureIndex in interface MorphiumWriterpublic int writeBufferCount()
writeBufferCount in interface MorphiumWriterpublic <T> void store(List<T> lst, String collectionName, AsyncOperationCallback<T> c)
store in interface MorphiumWriterpublic void flush()
flush in interface MorphiumWriterprotected void finalize()
throws Throwable
public void onShutdown(Morphium m)
onShutdown in interface ShutdownListenerpublic void setMaximumQueingTries(int n)
setMaximumQueingTries in interface MorphiumWriterpublic void setPauseBetweenTries(int p)
setPauseBetweenTries in interface MorphiumWriterCopyright © 2015. All rights reserved.