// Get CouchDb client
CouchDb couchDb = dumpSettings.createCouchDb();
// Create restore process
DbRestoreListener listener = new RestoreListener(dumpSettings.getOutStream());
DbRestoreProcess restoreProcess = new DbRestoreProcess(couchDb, dumpDir);
restoreProcess.setListener(listener);
List<String> docIds = dumpSettings.getDocIds();
if( docIds.size() < 1 ) {
restoreProcess.setAllDocs(true);
} else {
for(String docId : docIds) {
restoreProcess.addDocId(docId);
}
}
restoreProcess.restore();
}