public abstract class AbstractMongoCollection<KEY> extends java.lang.Object implements MongoCollection<KEY>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
idField |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMongoCollection(java.lang.String databaseName,
java.lang.String collectionName,
java.lang.String idField) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDocument(org.bson.BSONObject document) |
protected abstract KEY |
addDocumentInternal(org.bson.BSONObject document) |
void |
addIndex(Index<KEY> index) |
int |
count(org.bson.BSONObject query) |
int |
deleteDocuments(org.bson.BSONObject selector,
int limit) |
protected boolean |
documentMatchesQuery(org.bson.BSONObject document,
org.bson.BSONObject query) |
org.bson.BSONObject |
findAndModify(org.bson.BSONObject query) |
protected abstract KEY |
findDocument(org.bson.BSONObject document) |
java.lang.String |
getCollectionName() |
java.lang.String |
getDatabaseName() |
protected abstract long |
getDataSize() |
protected abstract int |
getDeletedCount() |
protected abstract org.bson.BSONObject |
getDocument(KEY key) |
java.lang.String |
getFullName() |
int |
getNumIndexes() |
protected abstract int |
getRecordCount() |
org.bson.BSONObject |
getStats() |
org.bson.BSONObject |
handleDistinct(org.bson.BSONObject query) |
java.lang.Iterable<org.bson.BSONObject> |
handleQuery(org.bson.BSONObject queryObject,
int numberToSkip,
int numberToReturn) |
java.lang.Iterable<org.bson.BSONObject> |
handleQuery(org.bson.BSONObject queryObject,
int numberToSkip,
int numberToReturn,
org.bson.BSONObject fieldSelector) |
int |
insertDocuments(java.util.List<org.bson.BSONObject> documents) |
protected abstract java.lang.Iterable<org.bson.BSONObject> |
matchDocuments(org.bson.BSONObject query,
org.bson.BSONObject orderBy,
int numberToSkip,
int numberToReturn) |
protected abstract java.lang.Iterable<org.bson.BSONObject> |
matchDocuments(org.bson.BSONObject query,
java.lang.Iterable<KEY> keys,
org.bson.BSONObject orderBy,
int numberToSkip,
int numberToReturn) |
protected java.lang.Iterable<org.bson.BSONObject> |
queryDocuments(org.bson.BSONObject query,
org.bson.BSONObject orderBy,
int numberToSkip,
int numberToReturn) |
void |
removeDocument(org.bson.BSONObject document) |
protected abstract void |
removeDocumentWithKey(KEY key) |
void |
renameTo(java.lang.String newDatabaseName,
java.lang.String newCollectionName) |
java.lang.String |
toString() |
protected abstract void |
updateDataSize(long sizeDelta) |
org.bson.BSONObject |
updateDocuments(org.bson.BSONObject selector,
org.bson.BSONObject updateQuery,
boolean isMulti,
boolean isUpsert) |
org.bson.BSONObject |
validate() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcount, dropprotected AbstractMongoCollection(java.lang.String databaseName,
java.lang.String collectionName,
java.lang.String idField)
protected boolean documentMatchesQuery(org.bson.BSONObject document,
org.bson.BSONObject query)
throws MongoServerException
MongoServerExceptionprotected java.lang.Iterable<org.bson.BSONObject> queryDocuments(org.bson.BSONObject query,
org.bson.BSONObject orderBy,
int numberToSkip,
int numberToReturn)
throws MongoServerException
MongoServerExceptionprotected abstract java.lang.Iterable<org.bson.BSONObject> matchDocuments(org.bson.BSONObject query,
org.bson.BSONObject orderBy,
int numberToSkip,
int numberToReturn)
throws MongoServerException
MongoServerExceptionprotected abstract java.lang.Iterable<org.bson.BSONObject> matchDocuments(org.bson.BSONObject query,
java.lang.Iterable<KEY> keys,
org.bson.BSONObject orderBy,
int numberToSkip,
int numberToReturn)
throws MongoServerException
MongoServerExceptionprotected abstract org.bson.BSONObject getDocument(KEY key)
protected abstract void updateDataSize(long sizeDelta)
protected abstract long getDataSize()
protected abstract KEY addDocumentInternal(org.bson.BSONObject document)
public void addDocument(org.bson.BSONObject document)
throws MongoServerException
addDocument in interface MongoCollection<KEY>MongoServerExceptionpublic java.lang.String getDatabaseName()
getDatabaseName in interface MongoCollection<KEY>public java.lang.String getFullName()
getFullName in interface MongoCollection<KEY>public java.lang.String getCollectionName()
getCollectionName in interface MongoCollection<KEY>public java.lang.String toString()
toString in class java.lang.Objectpublic void addIndex(Index<KEY> index)
addIndex in interface MongoCollection<KEY>public org.bson.BSONObject findAndModify(org.bson.BSONObject query)
throws MongoServerException
findAndModify in interface MongoCollection<KEY>MongoServerExceptionpublic java.lang.Iterable<org.bson.BSONObject> handleQuery(org.bson.BSONObject queryObject,
int numberToSkip,
int numberToReturn)
throws MongoServerException
MongoServerExceptionpublic java.lang.Iterable<org.bson.BSONObject> handleQuery(org.bson.BSONObject queryObject,
int numberToSkip,
int numberToReturn,
org.bson.BSONObject fieldSelector)
throws MongoServerException
handleQuery in interface MongoCollection<KEY>MongoServerExceptionpublic org.bson.BSONObject handleDistinct(org.bson.BSONObject query)
throws MongoServerException
handleDistinct in interface MongoCollection<KEY>MongoServerExceptionpublic int insertDocuments(java.util.List<org.bson.BSONObject> documents)
throws MongoServerException
insertDocuments in interface MongoCollection<KEY>MongoServerExceptionpublic int deleteDocuments(org.bson.BSONObject selector,
int limit)
throws MongoServerException
deleteDocuments in interface MongoCollection<KEY>MongoServerExceptionpublic org.bson.BSONObject updateDocuments(org.bson.BSONObject selector,
org.bson.BSONObject updateQuery,
boolean isMulti,
boolean isUpsert)
throws MongoServerException
updateDocuments in interface MongoCollection<KEY>MongoServerExceptionpublic int getNumIndexes()
getNumIndexes in interface MongoCollection<KEY>public int count(org.bson.BSONObject query)
throws MongoServerException
count in interface MongoCollection<KEY>MongoServerExceptionpublic org.bson.BSONObject getStats()
getStats in interface MongoCollection<KEY>public void removeDocument(org.bson.BSONObject document)
throws MongoServerException
removeDocument in interface MongoCollection<KEY>MongoServerExceptionpublic org.bson.BSONObject validate()
validate in interface MongoCollection<KEY>public void renameTo(java.lang.String newDatabaseName,
java.lang.String newCollectionName)
renameTo in interface MongoCollection<KEY>protected abstract void removeDocumentWithKey(KEY key)
protected abstract KEY findDocument(org.bson.BSONObject document)
protected abstract int getRecordCount()
protected abstract int getDeletedCount()