use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class InMemoryFeedManagerFeedService method getFeedVersion.
@Override
public Optional<EntityVersion> getFeedVersion(String feedId, String versionId, boolean includeContent) {
FeedMetadata feed = getFeedById(feedId);
EntityVersion version = null;
if (feed != null) {
version = new EntityVersion(UUID.randomUUID().toString(), "v1.0", feed.getCreateDate());
if (includeContent) {
version.setEntity(feed);
}
}
return Optional.ofNullable(version);
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class InMemoryFeedManagerFeedService method getFeedVersions.
@Override
public FeedVersions getFeedVersions(String feedId, boolean includeContent) {
FeedVersions versions = new FeedVersions(feedId);
FeedMetadata feed = getFeedById(feedId);
if (feed != null) {
EntityVersion version = versions.addNewVersion(UUID.randomUUID().toString(), "v1.0", feed.getCreateDate());
if (includeContent) {
version.setEntity(feed);
}
}
return versions;
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class InMemoryFeedManagerFeedService method postConstruct.
@PostConstruct
private void postConstruct() {
Collection<FeedMetadata> savedFeeds = FileObjectPersistence.getInstance().getFeedsFromFile();
if (savedFeeds != null) {
Long maxId = 0L;
for (FeedMetadata feed : savedFeeds) {
// update the category mappings
String categoryId = feed.getCategory().getId();
FeedCategory category = categoryProvider.getCategoryById(categoryId);
feed.setCategory(category);
category.addRelatedFeed(new FeedSummary(feed));
// add it to the map
feeds.put(feed.getId(), feed);
}
loadSavedFeedsToMetaClientStore();
}
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class InMemoryFeedManagerFeedService method getFeedById.
@Override
public FeedMetadata getFeedById(String id, boolean refreshTargetTableSchema) {
if (feeds != null && !feeds.isEmpty()) {
FeedMetadata feed = feeds.get(id);
if (feed != null) {
// get the latest category data
FeedCategory category = categoryProvider.getCategoryById(feed.getCategory().getId());
feed.setCategory(category);
// set the template to the feed
RegisteredTemplate registeredTemplate = templateProvider.getRegisteredTemplate(feed.getTemplateId());
if (registeredTemplate != null) {
RegisteredTemplate copy = new RegisteredTemplate(registeredTemplate);
copy.getProperties().clear();
feed.setRegisteredTemplate(copy);
feed.setTemplateId(copy.getNifiTemplateId());
}
return feed;
}
}
return null;
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class FeedImporter method validateSensitiveProperties.
private boolean validateSensitiveProperties() {
FeedMetadata metadata = importFeed.getFeedToImport();
// detect any sensitive properties and prompt for input before proceeding
UploadProgressMessage statusMessage = uploadProgressService.addUploadStatus(importFeed.getImportOptions().getUploadKey(), "Validating feed properties.");
List<NifiProperty> sensitiveProperties = metadata.getSensitiveProperties();
ImportUtil.addToImportOptionsSensitiveProperties(importFeedOptions, sensitiveProperties, ImportComponent.FEED_DATA);
boolean valid = ImportUtil.applyImportPropertiesToFeed(metadata, importFeed, ImportComponent.FEED_DATA);
if (!valid) {
statusMessage.update("Validation Error. Additional properties are needed before uploading the feed.", false);
importFeed.setValid(false);
} else {
statusMessage.update("Validated feed properties.", valid);
}
uploadProgressService.completeSection(importFeed.getImportOptions(), ImportSection.Section.VALIDATE_PROPERTIES);
return valid;
}
Aggregations