use of com.thinkbiganalytics.nifi.rest.model.NiFiRemoteProcessGroup in project kylo by Teradata.
the class NifiRemoteProcessGroupUtil method toRemoteProcessGroup.
public static NiFiRemoteProcessGroup toRemoteProcessGroup(RemoteProcessGroupDTO groupDTO) {
NiFiRemoteProcessGroup remoteProcessGroup = new NiFiRemoteProcessGroup();
remoteProcessGroup.setId(groupDTO.getId());
remoteProcessGroup.setName(groupDTO.getName());
remoteProcessGroup.setActiveRemoteInputPortCount(groupDTO.getActiveRemoteInputPortCount());
remoteProcessGroup.setActiveRemoteOutputPortCount(groupDTO.getActiveRemoteOutputPortCount());
remoteProcessGroup.setInactiveRemoteInputPortCount(groupDTO.getInactiveRemoteInputPortCount());
remoteProcessGroup.setInactiveRemoteOutputPortCount(groupDTO.getInactiveRemoteOutputPortCount());
remoteProcessGroup.setComments(groupDTO.getComments());
remoteProcessGroup.setAuthorizationIssues(groupDTO.getAuthorizationIssues());
// remoteProcessGroup.setValidationErrors(groupDTO.getValidationErrors());
remoteProcessGroup.setCommunicationsTimeout(groupDTO.getCommunicationsTimeout());
remoteProcessGroup.setOutputPortCount(groupDTO.getOutputPortCount());
remoteProcessGroup.setInputPortCount(groupDTO.getInputPortCount());
remoteProcessGroup.setTransportProtocol(groupDTO.getTransportProtocol());
// remoteProcessGroup.setTargetUris(groupDTO.getTargetUris());
remoteProcessGroup.setTargetUri(groupDTO.getTargetUri());
remoteProcessGroup.setProxyHost(groupDTO.getProxyHost());
remoteProcessGroup.setProxyPort(groupDTO.getProxyPort());
remoteProcessGroup.setProxyPassword(groupDTO.getProxyPassword());
remoteProcessGroup.setProxyUser(groupDTO.getProxyUser());
remoteProcessGroup.setCommunicationsTimeout(groupDTO.getCommunicationsTimeout());
remoteProcessGroup.setYieldDuration(groupDTO.getYieldDuration());
remoteProcessGroup.setTargetSecure(groupDTO.isTargetSecure());
remoteProcessGroup.setParentGroupId(groupDTO.getParentGroupId());
return remoteProcessGroup;
}
use of com.thinkbiganalytics.nifi.rest.model.NiFiRemoteProcessGroup in project kylo by Teradata.
the class RegisteredTemplateService method nifiTemplateToRegisteredTemplate.
/**
* this will return a RegisteredTemplate object for a given NiFi template Id.
* This is to be used for new templates that are going to be registered with Kylo.
* Callers of this method should ensure that a template of this id is not already registered
*
* @param nifiTemplateId the nifi template identifier
* @return a RegisteredTemplate object of null if not found in NiFi
*/
private RegisteredTemplate nifiTemplateToRegisteredTemplate(String nifiTemplateId) {
RegisteredTemplate registeredTemplate = null;
List<NifiProperty> properties = new ArrayList<>();
TemplateDTO nifiTemplate = nifiRestClient.getTemplateById(nifiTemplateId);
if (nifiTemplate != null) {
registeredTemplate = new RegisteredTemplate();
registeredTemplate.setNifiTemplateId(nifiTemplateId);
properties = niFiTemplateCache.getTemplateProperties(nifiTemplate, true, null);
// TODO not sure if this is needed
List<NiFiRemoteProcessGroup> remoteProcessGroups = niFiTemplateCache.getRemoteProcessGroups(nifiTemplate);
registeredTemplate.setRemoteProcessGroups(remoteProcessGroups);
registeredTemplate.setNifiTemplate(nifiTemplate);
registeredTemplate.setTemplateName(nifiTemplate.getName());
registeredTemplate.setProperties(properties);
}
return registeredTemplate;
}
Aggregations