Java Code Examples for org.apache.nifi.registry.flow.VersionedRemoteGroupPort#setComponentType()

The following examples show how to use org.apache.nifi.registry.flow.VersionedRemoteGroupPort#setComponentType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NiFiRegistryFlowMapper.java    From nifi with Apache License 2.0 5 votes vote down vote up
public VersionedRemoteGroupPort mapRemotePort(final RemoteGroupPort remotePort, final ComponentType componentType) {
    final VersionedRemoteGroupPort port = new InstantiatedVersionedRemoteGroupPort(remotePort.getIdentifier(), remotePort.getRemoteProcessGroup().getIdentifier());
    port.setIdentifier(getId(remotePort.getVersionedComponentId(), remotePort.getIdentifier()));
    port.setGroupIdentifier(getGroupId(remotePort.getRemoteProcessGroup().getIdentifier()));
    port.setComments(remotePort.getComments());
    port.setConcurrentlySchedulableTaskCount(remotePort.getMaxConcurrentTasks());
    port.setRemoteGroupId(getGroupId(remotePort.getRemoteProcessGroup().getIdentifier()));
    port.setName(remotePort.getName());
    port.setUseCompression(remotePort.isUseCompression());
    port.setBatchSize(mapBatchSettings(remotePort));
    port.setTargetId(remotePort.getTargetIdentifier());
    port.setComponentType(componentType);
    return port;
}
 
Example 2
Source File: TestFlowDifferenceFilters.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Test
public void testFilterAddedRemotePortsWithRemoteInputPortAsComponentB() {
    VersionedRemoteGroupPort remoteGroupPort = new VersionedRemoteGroupPort();
    remoteGroupPort.setComponentType(ComponentType.REMOTE_INPUT_PORT);

    StandardFlowDifference flowDifference = new StandardFlowDifference(
            DifferenceType.COMPONENT_ADDED, null, remoteGroupPort, null, null, "");

    // predicate should return false because we don't want to include changes for adding a remote input port
    Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
}
 
Example 3
Source File: TestFlowDifferenceFilters.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Test
public void testFilterAddedRemotePortsWithRemoteInputPortAsComponentA() {
    VersionedRemoteGroupPort remoteGroupPort = new VersionedRemoteGroupPort();
    remoteGroupPort.setComponentType(ComponentType.REMOTE_INPUT_PORT);

    StandardFlowDifference flowDifference = new StandardFlowDifference(
            DifferenceType.COMPONENT_ADDED, remoteGroupPort, null, null, null, "");

    // predicate should return false because we don't want to include changes for adding a remote input port
    Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
}
 
Example 4
Source File: TestFlowDifferenceFilters.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Test
public void testFilterAddedRemotePortsWithRemoteOutputPort() {
    VersionedRemoteGroupPort remoteGroupPort = new VersionedRemoteGroupPort();
    remoteGroupPort.setComponentType(ComponentType.REMOTE_OUTPUT_PORT);

    StandardFlowDifference flowDifference = new StandardFlowDifference(
            DifferenceType.COMPONENT_ADDED, null, remoteGroupPort, null, null, "");

    // predicate should return false because we don't want to include changes for adding a remote input port
    Assert.assertFalse(FlowDifferenceFilters.FILTER_ADDED_REMOVED_REMOTE_PORTS.test(flowDifference));
}