use of com.enonic.xp.impl.server.rest.model.SystemLoadResultJson in project xp by enonic.
the class LoadRunnableTask method run.
@Override
public void run(final TaskId id, final ProgressReporter progressReporter) {
SystemLoadResultJson result;
loadDumpListener = new SystemLoadListenerImpl(progressReporter);
final Path dumpRoot = getDumpRoot(params.getName());
if (isExport(dumpRoot)) {
result = doLoadFromExport(dumpRoot);
} else {
result = doLoadFromSystemDump(params);
}
progressReporter.info(result.toString());
}
use of com.enonic.xp.impl.server.rest.model.SystemLoadResultJson in project xp by enonic.
the class LoadRunnableTask method doLoadFromExport.
private SystemLoadResultJson doLoadFromExport(final Path rootDir) {
final SystemLoadResult.Builder builder = SystemLoadResult.create();
final Repositories repositories = repositoryService.list();
final long branchesCount = repositories.stream().flatMap(repository -> repository.getBranches().stream()).count();
loadDumpListener.totalBranches(branchesCount);
builder.add(importSystemRepo(rootDir));
this.repositoryService.invalidateAll();
for (Repository repository : repositories) {
initializeRepo(repository);
builder.add(importRepoBranches(rootDir, repository));
}
return SystemLoadResultJson.from(builder.build());
}
Aggregations