Search in sources :

Example 1 with EntityVersion

use of com.thinkbiganalytics.metadata.api.versioning.EntityVersion in project kylo by Teradata.

the class InitialFeedVersionUpgradeAction method upgradeTo.

@Override
public void upgradeTo(final KyloVersion startingVersion) {
    log.info("Upgrading feeds as versionable from version: {}", startingVersion);
    feedProvider.getFeeds().forEach(feed -> {
        JcrFeed jcrFeed = (JcrFeed) feed;
        List<EntityVersion<Feed.ID, Feed>> versions = feedProvider.findVersions(jcrFeed.getId(), false);
        if (versions.size() <= 1) {
            jcrFeed.setDescription(jcrFeed.getDescription());
            feedProvider.update(jcrFeed);
        }
    });
}
Also used : EntityVersion(com.thinkbiganalytics.metadata.api.versioning.EntityVersion) JcrFeed(com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed) Feed(com.thinkbiganalytics.metadata.api.feed.Feed) JcrFeed(com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed)

Example 2 with EntityVersion

use of com.thinkbiganalytics.metadata.api.versioning.EntityVersion in project kylo by Teradata.

the class DraftVersionProviderMixin method createVersion.

@Override
default EntityVersion<PK, T> createVersion(PK entityId, String comment, boolean includeContent) {
    Version version = createVersionedEntity(entityId, comment);
    Node versionable = JcrVersionUtil.getFrozenNode(version);
    T entity = includeContent ? asEntity(entityId, versionable) : null;
    return new JcrEntityVersion<>(version, getChangeComment(entityId, versionable), entityId, entity);
}
Also used : JcrEntityVersion(com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityVersion) JcrEntityDraftVersion(com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityDraftVersion) Version(javax.jcr.version.Version) EntityVersion(com.thinkbiganalytics.metadata.api.versioning.EntityVersion) JcrEntityVersion(com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityVersion) Node(javax.jcr.Node)

Aggregations

EntityVersion (com.thinkbiganalytics.metadata.api.versioning.EntityVersion)2 Feed (com.thinkbiganalytics.metadata.api.feed.Feed)1 JcrFeed (com.thinkbiganalytics.metadata.modeshape.feed.JcrFeed)1 JcrEntityDraftVersion (com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityDraftVersion)1 JcrEntityVersion (com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityVersion)1 Node (javax.jcr.Node)1 Version (javax.jcr.version.Version)1