Example usage for com.mongodb Mongo getDB

List of usage examples for com.mongodb Mongo getDB

Introduction

In this page you can find the example usage for com.mongodb Mongo getDB.

Prototype

@Deprecated 
public DB getDB(final String dbName) 

Source Link

Document

Gets a database object.

Usage

From source file:com.ineunet.knife.persist.PersistUtils.java

License:Apache License

/**
 * //w  w w . jav a  2  s . c  o  m
 * @return jongo
 * 
 * @since 1.1.0
 */
public static Jongo getJongo() {
    if (jongo == null) {
        try {
            Mongo mongo = MongoManager.getMongoDBServer().getMongo();
            jongo = new Jongo(mongo.getDB(MongoManager.getMongoDBServer().getDefaultDbName()));
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e.getMessage());
            throw new PersistException("cannot get jongo", e);
        }
    }
    return jongo;
}

From source file:com.linuxbox.enkive.archiver.mongodb.MongoArchivingService.java

License:Open Source License

public MongoArchivingService(Mongo m, String dbName, String collName) {
    this(m.getDB(dbName).getCollection(collName));
}

From source file:com.linuxbox.enkive.audit.mongodb.MongoAuditService.java

License:Open Source License

public MongoAuditService(Mongo mongo, String database, String collection) {
    this(mongo, mongo.getDB(database).getCollection(collection));
}

From source file:com.linuxbox.enkive.docstore.mongogrid.MongoGridDocStoreService.java

License:Open Source License

public MongoGridDocStoreService(Mongo mongo, String dbName, String bucketName) {
    this(mongo.getDB(dbName), bucketName);
}

From source file:com.linuxbox.enkive.imap.mailbox.mongo.MongoEnkiveImapMailboxMapper.java

License:Open Source License

public MongoEnkiveImapMailboxMapper(MailboxSession session, Mongo m, String enkiveDbName,
        String imapCollectionName) {
    super(session);
    this.m = m;//from   w  w  w  . j  av  a 2s  . com
    enkiveDB = m.getDB(enkiveDbName);
    imapCollection = enkiveDB.getCollection(imapCollectionName);
}

From source file:com.linuxbox.enkive.imap.mailbox.mongo.MongoEnkiveSubscriptionManager.java

License:Open Source License

public MongoEnkiveSubscriptionManager(Mongo m, String imapDBName, String imapCollname) {
    this(m.getDB(imapDBName).getCollection(imapCollname));
}

From source file:com.linuxbox.enkive.imap.message.mongo.MongoEnkiveImapMessageMapper.java

License:Open Source License

public MongoEnkiveImapMessageMapper(MailboxSession mailboxSession, EnkiveImapStore store,
        MessageRetrieverService retrieverService, Mongo m, String enkiveDbName, String imapCollectionName) {
    super(mailboxSession, store, retrieverService);
    imapDB = m.getDB(enkiveDbName);
    imapCollection = imapDB.getCollection(imapCollectionName);
}

From source file:com.linuxbox.enkive.imap.mongo.MongoEnkiveImapStore.java

License:Open Source License

public MongoEnkiveImapStore(Mongo m, String imapDBName, String imapCollName) {
    this.m = m;//from w w  w.  j a v a2  s  .  c om
    imapDB = m.getDB(imapDBName);
    imapCollection = imapDB.getCollection(imapCollName);
}

From source file:com.linuxbox.enkive.imap.mongo.MongoImapAccountCreator.java

License:Open Source License

public MongoImapAccountCreator(Mongo m, String imapDBName, String imapCollName) {
    this(m.getDB(imapDBName), imapCollName);
}

From source file:com.linuxbox.enkive.message.retention.imap.mongodb.MongoDbImapMessageRetentionPolicyEnforcer.java

License:Open Source License

public MongoDbImapMessageRetentionPolicyEnforcer(Mongo m, String imapDbName, String imapCollectionName) {
    this(m.getDB(imapDbName).getCollection(imapCollectionName));
}