use of com.enonic.xp.repo.impl.dump.serializer.json.BranchDumpEntryJson in project xp by enonic.
the class IndexConfigUpgrader method upgradeBranchEntry.
@Override
protected byte[] upgradeBranchEntry(final RepositoryId repositoryId, final String entryContent) {
final BranchDumpEntryJson sourceBranchEntry = deserializeValue(entryContent, BranchDumpEntryJson.class);
final VersionDumpEntryJson sourceVersionEntry = sourceBranchEntry.getMeta();
final VersionDumpEntryJson upgradedVersionEntry = upgradeVersionMeta(sourceVersionEntry);
if (!sourceVersionEntry.equals(upgradedVersionEntry)) {
return serialize(BranchDumpEntryJson.create(sourceBranchEntry).meta(upgradedVersionEntry).build());
}
return entryContent.getBytes(StandardCharsets.UTF_8);
}
use of com.enonic.xp.repo.impl.dump.serializer.json.BranchDumpEntryJson in project xp by enonic.
the class CommitDumpUpgrader method upgradeBranchEntry.
@Override
protected byte[] upgradeBranchEntry(final RepositoryId repositoryId, final String entryContent) {
if (processingMaster) {
final Pre6BranchDumpEntryJson sourceEntry = deserializeValue(entryContent, Pre6BranchDumpEntryJson.class);
commitedNodeIds.add(sourceEntry.getNodeId());
commitedVersionIds.add(sourceEntry.getMeta().getVersion());
final BranchDumpEntryJson upgradedEntry = upgradeBranchDumpEntry(sourceEntry, true);
return serialize(upgradedEntry);
} else {
final Pre6BranchDumpEntryJson sourceEntry = deserializeValue(entryContent, Pre6BranchDumpEntryJson.class);
final boolean commit = commitedVersionIds.contains(sourceEntry.getMeta().getVersion());
final BranchDumpEntryJson upgradedEntry = upgradeBranchDumpEntry(sourceEntry, commit);
return serialize(upgradedEntry);
}
}
use of com.enonic.xp.repo.impl.dump.serializer.json.BranchDumpEntryJson in project xp by enonic.
the class HtmlAreaDumpUpgrader method upgradeBranchEntry.
@Override
protected void upgradeBranchEntry(final RepositoryId repositoryId, final String entryContent) {
final BranchDumpEntryJson branchDumpEntryJson = deserializeValue(entryContent, BranchDumpEntryJson.class);
final VersionDumpEntryJson versionDumpEntryJson = branchDumpEntryJson.getMeta();
upgradeVersionMeta(versionDumpEntryJson);
}
Aggregations