public abstract class AbstractMongoCollection<P> extends java.lang.Object implements MongoCollection<P>
| 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(Document document) |
protected abstract P |
addDocumentInternal(Document document) |
void |
addIndex(Index<P> index) |
int |
count(Document query,
int skip,
int limit) |
int |
deleteDocuments(Document selector,
int limit) |
protected boolean |
documentMatchesQuery(Document document,
Document query) |
Document |
findAndModify(Document query) |
protected abstract P |
findDocumentPosition(Document document) |
java.lang.String |
getCollectionName() |
java.lang.String |
getDatabaseName() |
protected abstract long |
getDataSize() |
protected abstract int |
getDeletedCount() |
protected abstract Document |
getDocument(P position) |
java.lang.String |
getFullName() |
int |
getNumIndexes() |
protected abstract int |
getRecordCount() |
Document |
getStats() |
Document |
handleDistinct(Document query) |
java.lang.Iterable<Document> |
handleQuery(Document queryObject,
int numberToSkip,
int numberToReturn,
Document fieldSelector) |
protected abstract void |
handleUpdate(Document document) |
int |
insertDocuments(java.util.List<Document> documents) |
protected abstract java.lang.Iterable<Document> |
matchDocuments(Document query,
Document orderBy,
int numberToSkip,
int numberToReturn) |
protected abstract java.lang.Iterable<Document> |
matchDocuments(Document query,
java.lang.Iterable<P> positions,
Document orderBy,
int numberToSkip,
int numberToReturn) |
void |
removeDocument(Document document) |
protected abstract void |
removeDocument(P position) |
void |
renameTo(java.lang.String newDatabaseName,
java.lang.String newCollectionName) |
protected void |
sortDocumentsInMemory(java.util.List<Document> documents,
Document orderBy) |
java.lang.String |
toString() |
protected abstract void |
updateDataSize(long sizeDelta) |
Document |
updateDocuments(Document selector,
Document updateQuery,
boolean isMulti,
boolean isUpsert) |
Document |
validate() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcount, drop, handleQuery, handleQuery, queryAllprotected AbstractMongoCollection(java.lang.String databaseName,
java.lang.String collectionName,
java.lang.String idField)
protected boolean documentMatchesQuery(Document document, Document query) throws MongoServerException
MongoServerExceptionprotected void sortDocumentsInMemory(java.util.List<Document> documents, Document orderBy)
protected abstract java.lang.Iterable<Document> matchDocuments(Document query, Document orderBy, int numberToSkip, int numberToReturn) throws MongoServerException
MongoServerExceptionprotected abstract java.lang.Iterable<Document> matchDocuments(Document query, java.lang.Iterable<P> positions, Document orderBy, int numberToSkip, int numberToReturn) throws MongoServerException
MongoServerExceptionprotected abstract void updateDataSize(long sizeDelta)
throws MongoServerException
MongoServerExceptionprotected abstract long getDataSize()
throws MongoServerException
MongoServerExceptionprotected abstract P addDocumentInternal(Document document) throws MongoServerException
MongoServerExceptionpublic void addDocument(Document document) throws MongoServerException
addDocument in interface MongoCollection<P>MongoServerExceptionpublic java.lang.String getDatabaseName()
getDatabaseName in interface MongoCollection<P>public java.lang.String getFullName()
getFullName in interface MongoCollection<P>public java.lang.String getCollectionName()
getCollectionName in interface MongoCollection<P>public java.lang.String toString()
toString in class java.lang.Objectpublic void addIndex(Index<P> index)
addIndex in interface MongoCollection<P>public Document findAndModify(Document query) throws MongoServerException
findAndModify in interface MongoCollection<P>MongoServerExceptionpublic java.lang.Iterable<Document> handleQuery(Document queryObject, int numberToSkip, int numberToReturn, Document fieldSelector) throws MongoServerException
handleQuery in interface MongoCollection<P>MongoServerExceptionpublic Document handleDistinct(Document query) throws MongoServerException
handleDistinct in interface MongoCollection<P>MongoServerExceptionpublic int insertDocuments(java.util.List<Document> documents) throws MongoServerException
insertDocuments in interface MongoCollection<P>MongoServerExceptionpublic int deleteDocuments(Document selector, int limit) throws MongoServerException
deleteDocuments in interface MongoCollection<P>MongoServerExceptionpublic Document updateDocuments(Document selector, Document updateQuery, boolean isMulti, boolean isUpsert) throws MongoServerException
updateDocuments in interface MongoCollection<P>MongoServerExceptionprotected abstract void handleUpdate(Document document) throws MongoServerException
MongoServerExceptionpublic int getNumIndexes()
getNumIndexes in interface MongoCollection<P>public int count(Document query, int skip, int limit) throws MongoServerException
count in interface MongoCollection<P>MongoServerExceptionpublic Document getStats() throws MongoServerException
getStats in interface MongoCollection<P>MongoServerExceptionpublic void removeDocument(Document document) throws MongoServerException
removeDocument in interface MongoCollection<P>MongoServerExceptionpublic Document validate() throws MongoServerException
validate in interface MongoCollection<P>MongoServerExceptionpublic void renameTo(java.lang.String newDatabaseName,
java.lang.String newCollectionName)
throws MongoServerException
renameTo in interface MongoCollection<P>MongoServerExceptionprotected abstract void removeDocument(P position) throws MongoServerException
MongoServerExceptionprotected abstract P findDocumentPosition(Document document) throws MongoServerException
MongoServerExceptionprotected abstract int getRecordCount()
protected abstract int getDeletedCount()