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