use of org.openntf.domino.View in project org.openntf.domino by OpenNTF.
the class SessionTests method run.
@Override
public void run() {
Session sess = Factory.getSession(SessionType.NATIVE);
Database db = sess.getDatabase("names.nsf");
View vw = db.getView("$Users");
Document doc = vw.getFirstDocument();
String metaversalId = doc.getMetaversalID();
System.out.println(metaversalId);
Document doc2 = sess.getDocumentByMetaversalID(db.getServer(), metaversalId);
if (null == doc2) {
System.out.println("Failed");
} else {
System.out.println("Worked");
}
Document doc3 = sess.getDocumentByMetaversalID(metaversalId);
if (null == doc2) {
System.out.println("Failed");
} else {
System.out.println("Worked");
}
}
use of org.openntf.domino.View in project org.openntf.domino by OpenNTF.
the class MassViewEntryCollectionTest method run.
@Test
public void run() {
Session s = Factory.getSession(SessionType.CURRENT);
Database source = s.getDatabase("", TARGET, true);
View view = source.getView(VIEW);
System.out.println("-- START --");
long start = System.nanoTime();
int i = 0;
if (null != view) {
view.setAutoUpdate(false);
System.out.println(view.getEntryCount());
for (ViewEntry entry : view.getAllEntries()) {
i++;
}
/* */
view.setAutoUpdate(true);
}
System.out.println(i);
long elapsed = System.nanoTime() - start;
System.out.println("-- STOP --");
System.out.println("Thread " + Thread.currentThread().getName() + " elapsed time: " + elapsed / 1000000 + "ms");
}
use of org.openntf.domino.View in project org.openntf.domino by OpenNTF.
the class MassViewNavigatorSkipTest method run.
@Test
public void run() {
Session s = Factory.getSession(SessionType.CURRENT);
Database source = s.getDatabase("", TARGET, true);
View view = source.getView(VIEW);
System.out.println("-- START --");
long start = System.nanoTime();
if (null != view) {
view.setAutoUpdate(false);
System.out.println(view.getEntryCount());
ViewNavigator nav = view.createViewNav();
// nav.setCacheSize(400);
nav.skip(1000000);
System.out.println("CacheSize: " + nav.getCacheSize());
view.setAutoUpdate(true);
ViewEntry entry = null;
entry = nav.getFirst();
while (null != entry) {
entry = nav.getNext(entry);
}
}
long elapsed = System.nanoTime() - start;
System.out.println("-- STOP --");
System.out.println("Thread " + Thread.currentThread().getName() + " elapsed time: " + elapsed / 1000000 + "ms");
}
Aggregations