use of com.thinkbiganalytics.feedmgr.rest.model.DeployResponseEntityVersion in project kylo by Teradata.
the class DefaultFeedManagerFeedService method deployFeedVersion.
@Override
public DeployResponseEntityVersion deployFeedVersion(String feedIdStr, String versionIdStr, boolean includeContent) throws DeployFeedException {
Optional<Map.Entry<Feed.ID, ActionGroup>> feedAccess = checkChangeVersions(feedIdStr);
return feedAccess.map(entry -> {
Feed.ID domainFeedId = entry.getKey();
return metadataAccess.commit(() -> {
com.thinkbiganalytics.metadata.api.versioning.EntityVersion.ID versionId = this.feedProvider.resolveVersion(versionIdStr);
return this.feedProvider.findVersion(domainFeedId, versionId, true).map(ver -> {
Feed feed = ver.getEntity().get();
// validate the required user properties
// Set user-defined properties
Set<UserFieldDescriptor> fields = feedModelTransform.getUserFields(feed.getCategory());
if (fields != null && !fields.isEmpty()) {
if (feed.isMissingRequiredProperties(fields)) {
throw new MetadataRepositoryException("Unable to deploy the feed. It is missing required properties ");
}
}
FeedMetadata feedMetadata = feedModelTransform.domainToFeedMetadata(feed, entry.getValue());
NifiFeed deployedFeed = deployFeed(feedMetadata, ver);
EntityVersion entityVersion = feedModelTransform.domainToFeedVersion(feedProvider.findVersion(domainFeedId, versionId, includeContent).get(), entry.getValue());
return new DeployResponseEntityVersion(entityVersion, deployedFeed);
}).orElseThrow(() -> new FeedNotFoundException(domainFeedId));
}, MetadataAccess.SERVICE);
}).orElseThrow(() -> new FeedNotFoundException(this.feedProvider.resolveFeed(feedIdStr)));
}
use of com.thinkbiganalytics.feedmgr.rest.model.DeployResponseEntityVersion in project kylo by Teradata.
the class FeedManagerMetadataService method deployFeedVersion.
@Override
public DeployResponseEntityVersion deployFeedVersion(String feedId, String versionId, boolean includeContent) {
DeployResponseEntityVersion version = feedProvider.deployFeedVersion(feedId, versionId, includeContent);
afterDeployedFeed(version.getFeed());
return version;
}
Aggregations