Search in sources :

Example 1 with JcrEntityVersion

use of com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityVersion 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)

Example 2 with JcrEntityVersion

use of com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityVersion in project kylo by Teradata.

the class JcrFeedProvider method findDeployedVersion.

/* (non-Javadoc)
     * @see com.thinkbiganalytics.metadata.api.feed.FeedProvider#findDeployedVersion(com.thinkbiganalytics.metadata.api.feed.Feed.ID, boolean)
     */
@Override
public Optional<EntityVersion<Feed.ID, Feed>> findDeployedVersion(ID feedId, boolean includeContent) {
    final JcrFeed feed = (JcrFeed) super.findById(feedId);
    if (feed != null) {
        return feed.getDeployedVersion().map(version -> {
            Node versionable = JcrVersionUtil.getFrozenNode(version);
            Feed versionedFeed = includeContent ? asEntity(feedId, versionable) : null;
            return new JcrEntityVersion<>(version, getChangeComment(feedId, versionable), feedId, versionedFeed);
        });
    } else {
        throw new FeedNotFoundException(feedId);
    }
}
Also used : JcrEntityVersion(com.thinkbiganalytics.metadata.modeshape.versioning.JcrEntityVersion) Node(javax.jcr.Node) FeedNotFoundException(com.thinkbiganalytics.metadata.api.feed.FeedNotFoundException) Feed(com.thinkbiganalytics.metadata.api.feed.Feed)

Aggregations

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