Java Code Examples for com.mongodb.DBCollection#getName()

The following examples show how to use com.mongodb.DBCollection#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PeriodicAllocator.java    From hvdf with Apache License 2.0 5 votes vote down vote up
@Override
public DBCollection getPreviousWithLimit(DBCollection current, long minTime) {
	
	// figure out the current timeslice
	String currentName = current.getName();
	long currSuffix = getSuffix(currentName);
	
	// If minTime is before the lower bound of this collection,
	// just get the collection with the previous suffix
	if(minTime < currSuffix*this.period){
		return db.getCollection(this.prefix + (currSuffix - 1));
	}

	return null;
}
 
Example 2
Source File: PongoFactory.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
protected String getFullyQualifiedId(DBObject dbObject, DBCollection dbCollection) {
	if (dbCollection == null) return null;
	return dbCollection.getDB().getName() + "." + dbCollection.getName() + "." + dbObject.get("_id");
}