Search in sources :

Example 1 with Pre6VersionDumpEntryJson

use of com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson 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 Pre6VersionDumpEntryJson

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

the class RepositoryIdDumpUpgrader method upgradeVersionDumpEntry.

private Pre6VersionDumpEntryJson upgradeVersionDumpEntry(final Pre6VersionDumpEntryJson sourceVersionEntry) {
    final Pre6VersionDumpEntryJson updatedVersionEntry = Pre6VersionDumpEntryJson.create(sourceVersionEntry).nodePath(upgradeString(sourceVersionEntry.getNodePath())).build();
    upgradeNodeVersionBlob(updatedVersionEntry.getNodeBlobKey());
    return updatedVersionEntry;
}
Also used : Pre6VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson)

Example 3 with Pre6VersionDumpEntryJson

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

the class RepositoryIdDumpUpgrader method upgradeBranchEntry.

@Override
protected byte[] upgradeBranchEntry(final RepositoryId repositoryId, final String entryContent) {
    final Pre6BranchDumpEntryJson sourceBranchEntry = deserializeValue(entryContent, Pre6BranchDumpEntryJson.class);
    final Pre6VersionDumpEntryJson sourceVersionEntry = sourceBranchEntry.getMeta();
    final Pre6VersionDumpEntryJson updatedVersionEntry = upgradeVersionDumpEntry(sourceVersionEntry);
    final Pre6BranchDumpEntryJson updatedBranchEntry = Pre6BranchDumpEntryJson.create(sourceBranchEntry).nodeId(upgradeString(sourceBranchEntry.getNodeId())).meta(updatedVersionEntry).build();
    return serialize(updatedBranchEntry);
}
Also used : Pre6VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson) Pre6BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson)

Example 4 with Pre6VersionDumpEntryJson

use of com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson 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 5 with Pre6VersionDumpEntryJson

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

the class IndexAccessSegmentsDumpUpgrader method upgradeBranchEntry.

@Override
protected byte[] upgradeBranchEntry(final RepositoryId repositoryId, final String entryContent) {
    final Pre4BranchDumpEntryJson branchDumpEntry = deserializeValue(entryContent, Pre4BranchDumpEntryJson.class);
    final Pre6VersionDumpEntryJson upgradedVersionDumpEntry = upgradeVersionDumpEntry(repositoryId, branchDumpEntry.getMeta());
    final Pre6BranchDumpEntryJson upgradedBranchDumpEntry = Pre6BranchDumpEntryJson.create().nodeId(branchDumpEntry.getNodeId()).binaries(branchDumpEntry.getBinaries()).meta(upgradedVersionDumpEntry).build();
    return serialize(upgradedBranchDumpEntry);
}
Also used : Pre4BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4BranchDumpEntryJson) Pre6VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson) Pre6BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson)

Aggregations

Pre6VersionDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson)5 Pre6BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson)3 Pre4BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4BranchDumpEntryJson)2 Pre6VersionsDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionsDumpEntryJson)2 BlobKey (com.enonic.xp.blob.BlobKey)1 Segment (com.enonic.xp.blob.Segment)1 DumpConstants (com.enonic.xp.repo.impl.dump.DumpConstants)1 DumpBlobRecord (com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord)1 AbstractMetaDumpUpgrader (com.enonic.xp.repo.impl.dump.upgrade.AbstractMetaDumpUpgrader)1 DumpUpgradeException (com.enonic.xp.repo.impl.dump.upgrade.DumpUpgradeException)1 Pre4NodeVersionJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4NodeVersionJson)1 Pre4VersionDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4VersionDumpEntryJson)1 Pre4VersionsDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4VersionsDumpEntryJson)1 AccessControlJson (com.enonic.xp.repo.impl.node.json.AccessControlJson)1 RepositoryId (com.enonic.xp.repository.RepositoryId)1 RepositorySegmentUtils (com.enonic.xp.repository.RepositorySegmentUtils)1 Version (com.enonic.xp.util.Version)1 CharSource (com.google.common.io.CharSource)1 IOException (java.io.IOException)1 StandardCharsets (java.nio.charset.StandardCharsets)1