本文整理汇总了Java中lotus.domino.Database.getAllDocuments方法的典型用法代码示例。如果您正苦于以下问题:Java Database.getAllDocuments方法的具体用法?Java Database.getAllDocuments怎么用?Java Database.getAllDocuments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lotus.domino.Database
的用法示例。
在下文中一共展示了Database.getAllDocuments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLocalDatabaseCopy
import lotus.domino.Database; //导入方法依赖的package包/类
public static String createLocalDatabaseCopy(Database db, String destDbName) throws Throwable {
Database newDb = null;
String newDbPath = null;
try {
// Make a copy of the database
newDb = db.createCopy(null, destDbName);
newDbPath = newDb.getFilePath();
// Copy all the docs
DocumentCollection col = db.getAllDocuments();
Document doc = col.getFirstDocument();
while (doc != null) {
doc.copyToDatabase(newDb);
doc = col.getNextDocument();
}
// Copy the profile docs
col = db.getProfileDocCollection(null);
doc = col.getFirstDocument();
while (doc != null) {
doc.copyToDatabase(newDb);
doc = col.getNextDocument();
}
} finally {
if (newDb != null) {
try {
// Ensure db is flushed to disk
newDb.recycle();
// Add a pause for safety, just in case another thread handles the flush
Thread.sleep(1000);
} catch (NotesException e) {
if (BluemixLogger.BLUEMIX_LOGGER.isErrorEnabled()) {
BluemixLogger.BLUEMIX_LOGGER.errorp(null, "createLocalDatabaseCopy", e, "Failed to recycle newDb"); // $NON-NLS-1$ $NLE-BluemixUtil.FailedtorecyclenewDb-2$
}
}
}
}
return newDbPath;
}