Search in sources :

Example 1 with ImportOptions

use of com.thinkbiganalytics.feedmgr.rest.model.ImportOptions in project kylo by Teradata.

the class ImportUtil method addToImportOptionsSensitiveProperties.

public static void addToImportOptionsSensitiveProperties(ImportOptions importOptions, List<NifiProperty> sensitiveProperties, ImportComponent component) {
    ImportComponentOption option = importOptions.findImportComponentOption(component);
    if (option.getProperties().isEmpty()) {
        option.setProperties(sensitiveProperties.stream().map(p -> new ImportProperty(p.getProcessorName(), p.getProcessorId(), p.getKey(), "", p.getProcessorType())).collect(Collectors.toList()));
    } else {
        // only add in those that are unique
        Map<String, ImportProperty> propertyMap = option.getProperties().stream().collect(Collectors.toMap(p -> p.getProcessorNameTypeKey(), p -> p));
        sensitiveProperties.stream().filter(nifiProperty -> !propertyMap.containsKey(nifiProperty.getProcessorNameTypeKey())).forEach(p -> {
            option.getProperties().add(new ImportProperty(p.getProcessorName(), p.getProcessorId(), p.getKey(), "", p.getProcessorType()));
        });
    }
}
Also used : FeedDataTransformation(com.thinkbiganalytics.feedmgr.rest.model.FeedDataTransformation) ZipInputStream(java.util.zip.ZipInputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) NifiError(com.thinkbiganalytics.nifi.rest.model.NifiError) ReusableTemplateConnectionInfo(com.thinkbiganalytics.feedmgr.rest.model.ReusableTemplateConnectionInfo) FeedMetadata(com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata) StringUtils(org.apache.commons.lang3.StringUtils) ImportOptions(com.thinkbiganalytics.feedmgr.rest.model.ImportOptions) HashSet(java.util.HashSet) ObjectMapperSerializer(com.thinkbiganalytics.json.ObjectMapperSerializer) ByteArrayInputStream(java.io.ByteArrayInputStream) ImportProperty(com.thinkbiganalytics.feedmgr.rest.model.ImportProperty) Map(java.util.Map) TypeReference(com.fasterxml.jackson.core.type.TypeReference) ImportType(com.thinkbiganalytics.feedmgr.rest.ImportType) RegisteredTemplate(com.thinkbiganalytics.feedmgr.rest.model.RegisteredTemplate) ZipEntry(java.util.zip.ZipEntry) Nonnull(javax.annotation.Nonnull) RemoteProcessGroupInputPort(com.thinkbiganalytics.feedmgr.rest.model.RemoteProcessGroupInputPort) ImportTemplate(com.thinkbiganalytics.feedmgr.service.template.importing.model.ImportTemplate) NifiProperty(com.thinkbiganalytics.nifi.rest.model.NifiProperty) FeedNameUtil(com.thinkbiganalytics.support.FeedNameUtil) StringWriter(java.io.StringWriter) Set(java.util.Set) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) ZipFileUtil(com.thinkbiganalytics.feedmgr.support.ZipFileUtil) IOUtils(org.apache.commons.io.IOUtils) List(java.util.List) ImportFeed(com.thinkbiganalytics.feedmgr.service.feed.importing.model.ImportFeed) Optional(java.util.Optional) ImportComponent(com.thinkbiganalytics.feedmgr.rest.ImportComponent) ImportComponentOption(com.thinkbiganalytics.feedmgr.rest.model.ImportComponentOption) NifiProcessGroup(com.thinkbiganalytics.nifi.rest.model.NifiProcessGroup) InputStream(java.io.InputStream) ImportProperty(com.thinkbiganalytics.feedmgr.rest.model.ImportProperty) ImportComponentOption(com.thinkbiganalytics.feedmgr.rest.model.ImportComponentOption)

Aggregations

TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 ImportComponent (com.thinkbiganalytics.feedmgr.rest.ImportComponent)1 ImportType (com.thinkbiganalytics.feedmgr.rest.ImportType)1 FeedDataTransformation (com.thinkbiganalytics.feedmgr.rest.model.FeedDataTransformation)1 FeedMetadata (com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata)1 ImportComponentOption (com.thinkbiganalytics.feedmgr.rest.model.ImportComponentOption)1 ImportOptions (com.thinkbiganalytics.feedmgr.rest.model.ImportOptions)1 ImportProperty (com.thinkbiganalytics.feedmgr.rest.model.ImportProperty)1 RegisteredTemplate (com.thinkbiganalytics.feedmgr.rest.model.RegisteredTemplate)1 RemoteProcessGroupInputPort (com.thinkbiganalytics.feedmgr.rest.model.RemoteProcessGroupInputPort)1 ReusableTemplateConnectionInfo (com.thinkbiganalytics.feedmgr.rest.model.ReusableTemplateConnectionInfo)1 ImportFeed (com.thinkbiganalytics.feedmgr.service.feed.importing.model.ImportFeed)1 ImportTemplate (com.thinkbiganalytics.feedmgr.service.template.importing.model.ImportTemplate)1 ZipFileUtil (com.thinkbiganalytics.feedmgr.support.ZipFileUtil)1 ObjectMapperSerializer (com.thinkbiganalytics.json.ObjectMapperSerializer)1 NifiError (com.thinkbiganalytics.nifi.rest.model.NifiError)1 NifiProcessGroup (com.thinkbiganalytics.nifi.rest.model.NifiProcessGroup)1 NifiProperty (com.thinkbiganalytics.nifi.rest.model.NifiProperty)1 FeedNameUtil (com.thinkbiganalytics.support.FeedNameUtil)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1