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