Java Code Examples for org.apache.nifi.groups.ProcessGroup#startFunnel()

The following examples show how to use org.apache.nifi.groups.ProcessGroup#startFunnel() . 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: StandardFunnelDAO.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
public Funnel createFunnel(String groupId, FunnelDTO funnelDTO) {
    if (funnelDTO.getParentGroupId() != null && !flowController.areGroupsSame(groupId, funnelDTO.getParentGroupId())) {
        throw new IllegalArgumentException("Cannot specify a different Parent Group ID than the Group to which the Funnel is being added.");
    }

    // get the desired group
    ProcessGroup group = locateProcessGroup(flowController, groupId);

    // create the funnel
    Funnel funnel = flowController.createFunnel(funnelDTO.getId());
    if (funnelDTO.getPosition() != null) {
        funnel.setPosition(new Position(funnelDTO.getPosition().getX(), funnelDTO.getPosition().getY()));
    }

    // add the funnel
    group.addFunnel(funnel);
    group.startFunnel(funnel);
    return funnel;
}
 
Example 2
Source File: StandardFunnelDAO.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
public Funnel createFunnel(String groupId, FunnelDTO funnelDTO) {
    if (funnelDTO.getParentGroupId() != null && !flowController.getFlowManager().areGroupsSame(groupId, funnelDTO.getParentGroupId())) {
        throw new IllegalArgumentException("Cannot specify a different Parent Group ID than the Group to which the Funnel is being added.");
    }

    // get the desired group
    ProcessGroup group = locateProcessGroup(flowController, groupId);

    // create the funnel
    Funnel funnel = flowController.getFlowManager().createFunnel(funnelDTO.getId());
    if (funnelDTO.getPosition() != null) {
        funnel.setPosition(new Position(funnelDTO.getPosition().getX(), funnelDTO.getPosition().getY()));
    }

    // add the funnel
    group.addFunnel(funnel);
    group.startFunnel(funnel);
    return funnel;
}
 
Example 3
Source File: FlowController.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
public void startConnectable(final Connectable connectable) {
    final ProcessGroup group = requireNonNull(connectable).getProcessGroup();

    writeLock.lock();
    try {
        if (initialized.get()) {
            switch (requireNonNull(connectable).getConnectableType()) {
                case FUNNEL:
                    group.startFunnel((Funnel) connectable);
                    break;
                case INPUT_PORT:
                case REMOTE_INPUT_PORT:
                    group.startInputPort((Port) connectable);
                    break;
                case OUTPUT_PORT:
                case REMOTE_OUTPUT_PORT:
                    group.startOutputPort((Port) connectable);
                    break;
                default:
                    throw new IllegalArgumentException();
            }
        } else {
            startConnectablesAfterInitialization.add(connectable);
        }
    } finally {
        writeLock.unlock();
    }
}
 
Example 4
Source File: FlowController.java    From nifi with Apache License 2.0 5 votes vote down vote up
public void startConnectable(final Connectable connectable) {
    final ProcessGroup group = requireNonNull(connectable).getProcessGroup();

    writeLock.lock();
    try {
        if (initialized.get()) {
            switch (requireNonNull(connectable).getConnectableType()) {
                case FUNNEL:
                    group.startFunnel((Funnel) connectable);
                    break;
                case INPUT_PORT:
                case REMOTE_INPUT_PORT:
                    group.startInputPort((Port) connectable);
                    break;
                case OUTPUT_PORT:
                case REMOTE_OUTPUT_PORT:
                    group.startOutputPort((Port) connectable);
                    break;
                default:
                    throw new IllegalArgumentException();
            }
        } else {
            startConnectablesAfterInitialization.add(connectable);
        }
    } finally {
        writeLock.unlock("startConnectable");
    }
}