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);
}
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;
}
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);
}
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);
}
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);
}
Aggregations