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);
}
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);
}
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_;
}
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);
}
Aggregations