Search in sources :

Example 1 with Pre6VersionsDumpEntryJson

use of com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson in project xp by enonic.

the class RepositoryIdDumpUpgrader method upgradeVersionEntry.

@Override
protected byte[] upgradeVersionEntry(final RepositoryId repositoryId, final String entryContent) {
    final Pre6VersionsDumpEntryJson sourceVersionsEntry = deserializeValue(entryContent, Pre6VersionsDumpEntryJson.class);
    final Collection<Pre6VersionDumpEntryJson> upgradedVersionList = sourceVersionsEntry.getVersions().stream().map(this::upgradeVersionDumpEntry).collect(Collectors.toList());
    final Pre6VersionsDumpEntryJson upgradedVersionsEntry = Pre6VersionsDumpEntryJson.create().nodeId(upgradeString(sourceVersionsEntry.getNodeId())).versions(upgradedVersionList).build();
    return serialize(upgradedVersionsEntry);
}
Also used : Pre6VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson) Pre6VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson)

Example 2 with Pre6VersionsDumpEntryJson

use of com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson in project xp by enonic.

the class IndexAccessSegmentsDumpUpgrader method upgradeVersionEntry.

@Override
protected byte[] upgradeVersionEntry(final RepositoryId repositoryId, final String entryContent) {
    final Pre4VersionsDumpEntryJson versionsDumpEntry = deserializeValue(entryContent, Pre4VersionsDumpEntryJson.class);
    Collection<Pre6VersionDumpEntryJson> versions = versionsDumpEntry.getVersions().stream().map(versionDumpEntry -> upgradeVersionDumpEntry(repositoryId, versionDumpEntry)).collect(Collectors.toList());
    final Pre6VersionsDumpEntryJson upgradedVersionsDumpEntry = Pre6VersionsDumpEntryJson.create().nodeId(versionsDumpEntry.getNodeId()).versions(versions).build();
    return serialize(upgradedVersionsDumpEntry);
}
Also used : AbstractMetaDumpUpgrader(com.enonic.xp.repo.impl.dump.upgrade.AbstractMetaDumpUpgrader) AccessControlJson(com.enonic.xp.repo.impl.node.json.AccessControlJson) Pre4BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4BranchDumpEntryJson) RepositorySegmentUtils(com.enonic.xp.repository.RepositorySegmentUtils) DumpUpgradeException(com.enonic.xp.repo.impl.dump.upgrade.DumpUpgradeException) Collection(java.util.Collection) Version(com.enonic.xp.util.Version) IOException(java.io.IOException) Segment(com.enonic.xp.blob.Segment) Pre6VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson) Collectors(java.util.stream.Collectors) BlobKey(com.enonic.xp.blob.BlobKey) StandardCharsets(java.nio.charset.StandardCharsets) Pre6BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson) Pre4NodeVersionJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4NodeVersionJson) Pre4VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4VersionDumpEntryJson) RepositoryId(com.enonic.xp.repository.RepositoryId) Pre6VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson) Pre4VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4VersionsDumpEntryJson) DumpBlobRecord(com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord) CharSource(com.google.common.io.CharSource) DumpConstants(com.enonic.xp.repo.impl.dump.DumpConstants) Path(java.nio.file.Path) Pre4VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4VersionsDumpEntryJson) Pre6VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson) Pre6VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson)

Example 3 with Pre6VersionsDumpEntryJson

use of com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson in project xp by enonic.

the class CommitDumpUpgrader method upgradeVersionEntry.

@Override
protected byte[] upgradeVersionEntry(final RepositoryId repositoryId, final String entryContent) {
    final Pre6VersionsDumpEntryJson sourceEntry = deserializeValue(entryContent, Pre6VersionsDumpEntryJson.class);
    final VersionsDumpEntryJson.Builder upgradedEntry = VersionsDumpEntryJson.create().nodeId(sourceEntry.getNodeId());
    sourceEntry.getVersions().stream().map(version -> {
        final boolean commit = commitedVersionIds.contains(version.getVersion());
        return upgradeVersionDumpEntry(version, commit);
    }).forEach(upgradedEntry::version);
    return serialize(upgradedEntry.build());
}
Also used : AbstractMetaDumpUpgrader(com.enonic.xp.repo.impl.dump.upgrade.AbstractMetaDumpUpgrader) BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.BranchDumpEntryJson) VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson) Files(java.nio.file.Files) Version(com.enonic.xp.util.Version) Pre6VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson) NodeCommitId(com.enonic.xp.node.NodeCommitId) VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.VersionDumpEntryJson) Pre6BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson) HashSet(java.util.HashSet) NodeCommitEntry(com.enonic.xp.node.NodeCommitEntry) RepositoryId(com.enonic.xp.repository.RepositoryId) Pre6VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson) CommitDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.CommitDumpEntryJson) Path(java.nio.file.Path) RepositoryConstants(com.enonic.xp.repository.RepositoryConstants) VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson) Pre6VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson) Pre6VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson)

Aggregations

Pre6VersionDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson)3 Pre6VersionsDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson)3 AbstractMetaDumpUpgrader (com.enonic.xp.repo.impl.dump.upgrade.AbstractMetaDumpUpgrader)2 Pre6BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson)2 RepositoryId (com.enonic.xp.repository.RepositoryId)2 Version (com.enonic.xp.util.Version)2 Path (java.nio.file.Path)2 BlobKey (com.enonic.xp.blob.BlobKey)1 Segment (com.enonic.xp.blob.Segment)1 NodeCommitEntry (com.enonic.xp.node.NodeCommitEntry)1 NodeCommitId (com.enonic.xp.node.NodeCommitId)1 DumpConstants (com.enonic.xp.repo.impl.dump.DumpConstants)1 DumpBlobRecord (com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord)1 BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.serializer.json.BranchDumpEntryJson)1 CommitDumpEntryJson (com.enonic.xp.repo.impl.dump.serializer.json.CommitDumpEntryJson)1 VersionDumpEntryJson (com.enonic.xp.repo.impl.dump.serializer.json.VersionDumpEntryJson)1 VersionsDumpEntryJson (com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson)1 DumpUpgradeException (com.enonic.xp.repo.impl.dump.upgrade.DumpUpgradeException)1 Pre4BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4BranchDumpEntryJson)1 Pre4NodeVersionJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4NodeVersionJson)1