use of com.enonic.xp.repo.impl.dump.model.VersionMeta in project xp by enonic.
the class BranchEntryProcessor method processLine.
@Override
public boolean processLine(final String line) throws IOException {
final EntryLoadResult.Builder result = EntryLoadResult.create();
final BranchDumpEntry branchDumpEntry = this.serializer.toBranchMetaEntry(line);
final VersionMeta meta = branchDumpEntry.getMeta();
addNode(result, branchDumpEntry, meta);
this.result = result.build();
return true;
}
use of com.enonic.xp.repo.impl.dump.model.VersionMeta in project xp by enonic.
the class VersionEntryProcessor method addVersions.
private void addVersions(final EntryLoadResult.Builder result, final VersionsDumpEntry versionsDumpEntry, final Set<VersionMeta> versions) {
for (final VersionMeta version : versions) {
final NodeVersion nodeVersion = getVersion(version);
if (nodeVersion == null) {
reportVersionError(result, version);
return;
}
try {
this.nodeService.importNodeVersion(ImportNodeVersionParams.create().nodeId(versionsDumpEntry.getNodeId()).timestamp(version.getTimestamp()).nodePath(version.getNodePath()).nodeVersion(nodeVersion).nodeVersionId(version.getVersion()).nodeCommitId(version.getNodeCommitId()).build());
validateOrAddBinary(nodeVersion, result);
result.successful();
} catch (Exception e) {
final String message = String.format("Cannot load version with id %s, path %s: %s", versionsDumpEntry.getNodeId(), version.getNodePath(), e.getMessage());
result.error(EntryLoadError.error(message));
LOG.error(message, e);
}
}
}
use of com.enonic.xp.repo.impl.dump.model.VersionMeta in project xp by enonic.
the class VersionEntryProcessor method processLine.
@Override
public boolean processLine(final String line) throws IOException {
final EntryLoadResult.Builder result = EntryLoadResult.create();
final VersionsDumpEntry nodeVersionsEntry = this.serializer.toNodeVersionsEntry(line);
final Set<VersionMeta> versions = nodeVersionsEntry.getVersions();
addVersions(result, nodeVersionsEntry, versions);
this.result = result.build();
return true;
}
Aggregations