Search in sources :

Example 1 with VersionMeta

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;
}
Also used : VersionMeta(com.enonic.xp.repo.impl.dump.model.VersionMeta) BranchDumpEntry(com.enonic.xp.repo.impl.dump.model.BranchDumpEntry)

Example 2 with VersionMeta

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);
        }
    }
}
Also used : NodeVersion(com.enonic.xp.node.NodeVersion) VersionMeta(com.enonic.xp.repo.impl.dump.model.VersionMeta) IOException(java.io.IOException) RepoLoadException(com.enonic.xp.repo.impl.dump.RepoLoadException)

Example 3 with VersionMeta

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;
}
Also used : VersionMeta(com.enonic.xp.repo.impl.dump.model.VersionMeta) VersionsDumpEntry(com.enonic.xp.repo.impl.dump.model.VersionsDumpEntry)

Aggregations

VersionMeta (com.enonic.xp.repo.impl.dump.model.VersionMeta)3 NodeVersion (com.enonic.xp.node.NodeVersion)1 RepoLoadException (com.enonic.xp.repo.impl.dump.RepoLoadException)1 BranchDumpEntry (com.enonic.xp.repo.impl.dump.model.BranchDumpEntry)1 VersionsDumpEntry (com.enonic.xp.repo.impl.dump.model.VersionsDumpEntry)1 IOException (java.io.IOException)1