Search in sources :

Example 16 with DbDirectory

use of org.openntf.domino.DbDirectory in project org.openntf.domino by OpenNTF.

the class ShardingDatabase method getStagingDatabase.

private Database getStagingDatabase() {
    StringBuilder builder = new StringBuilder();
    for (int i = 0; i < places_; i++) {
        builder.append('0');
    }
    String hashChunk = builder.toString();
    String dbName = baseName_ + "-" + hashChunk + ".nsf";
    if (!dbCache_.containsKey(dbName)) {
        String server = serverStrategy_ == null ? server_ : serverStrategy_.getServerForHashChunk(hashChunk);
        Database database = session_.getDatabase(server, dbName, true);
        if (!database.isOpen()) {
            DbDirectory dbdir = getDbDirectoryForHashChunk(hashChunk);
            database = createDatabase(dbdir, dbName);
        }
        dbCache_.put(dbName, database);
    }
    return dbCache_.get(dbName);
}
Also used : DbDirectory(org.openntf.domino.DbDirectory) Database(org.openntf.domino.Database)

Example 17 with DbDirectory

use of org.openntf.domino.DbDirectory in project org.openntf.domino by OpenNTF.

the class IndexDatabase method scanServer.

/* (non-Javadoc)
	 * @see org.openntf.domino.big.impl.IIndexDatabase#scanServer(org.openntf.domino.Session, java.lang.String)
	 */
@Override
public void scanServer(final Session session, final String serverName) {
    initIndexDb();
    DbDirectory dir = session.getDbDirectory(serverName);
    dir.setDirectoryType(DbDirectory.Type.DATABASE);
    for (Database db : dir) {
        if (!db.getReplicaID().equals(getIndexDb().getReplicaID())) {
            // if (!db.getFilePath().equalsIgnoreCase("redpill\\graph.nsf")) {
            try {
                scanDatabase(db);
            } catch (Throwable t) {
                t.printStackTrace();
            }
        // }
        }
        if (!continue_) {
            System.out.println("Escaping process early due to continue_ == false");
            return;
        }
    }
    System.out.println("Completed scan of server " + serverName);
}
Also used : DbDirectory(org.openntf.domino.DbDirectory) Database(org.openntf.domino.Database)

Example 18 with DbDirectory

use of org.openntf.domino.DbDirectory in project org.openntf.domino by OpenNTF.

the class LocalNoteList method getDatabase.

protected Database getDatabase() {
    if (db_ == null) {
        String replid = getReplidFromLong(replid_);
        Session session = Factory.getSession(SessionType.CURRENT);
        DbDirectory dir = session.getDbDirectory(serverName_);
        db_ = dir.openDatabaseByReplicaID(replid);
    }
    return db_;
}
Also used : DbDirectory(org.openntf.domino.DbDirectory) Session(org.openntf.domino.Session)

Example 19 with DbDirectory

use of org.openntf.domino.DbDirectory in project org.openntf.domino by OpenNTF.

the class NoteCoordinate method getDatabase.

protected Database getDatabase(final String server) {
    String replid = getReplidFromLong(db);
    Session session = Factory.getSession(SessionType.CURRENT);
    DbDirectory dir = session.getDbDirectory(server);
    return dir.openDatabaseByReplicaID(replid);
}
Also used : DbDirectory(org.openntf.domino.DbDirectory) Session(org.openntf.domino.Session)

Aggregations

DbDirectory (org.openntf.domino.DbDirectory)19 Database (org.openntf.domino.Database)17 Session (org.openntf.domino.Session)11 FileNotFoundException (java.io.FileNotFoundException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Future (java.util.concurrent.Future)1 Test (org.junit.Test)1 ACL (org.openntf.domino.ACL)1 Document (org.openntf.domino.Document)1 View (org.openntf.domino.View)1 IndexDatabase (org.openntf.domino.big.IndexDatabase)1 AboutDocument (org.openntf.domino.design.AboutDocument)1 OpenNTFNotesException (org.openntf.domino.exceptions.OpenNTFNotesException)1 UserAccessException (org.openntf.domino.exceptions.UserAccessException)1 ScheduleData (org.openntf.domino.xots.ScheduleData)1