Search in sources :

Example 1 with Pre6BranchDumpEntryJson

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

use of com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson 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);
    }
}
Also used : Pre6BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson) BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.BranchDumpEntryJson) Pre6BranchDumpEntryJson(com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson)

Example 3 with Pre6BranchDumpEntryJson

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

Pre6BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6BranchDumpEntryJson)3 Pre6VersionDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre6.Pre6VersionDumpEntryJson)2 BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.serializer.json.BranchDumpEntryJson)1 Pre4BranchDumpEntryJson (com.enonic.xp.repo.impl.dump.upgrade.obsoletemodel.pre4.Pre4BranchDumpEntryJson)1