Java Code Examples for org.apache.nifi.groups.RemoteProcessGroup#getOutputPort()

The following examples show how to use org.apache.nifi.groups.RemoteProcessGroup#getOutputPort() . 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: StandardRemoteProcessGroupDAO.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
public RemoteGroupPort updateRemoteProcessGroupOutputPort(String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) {
    final RemoteProcessGroup remoteProcessGroup = locateRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort port = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());

    if (port == null) {
        throw new ResourceNotFoundException(
                String.format("Unable to find remote process group output port with id '%s'.", remoteProcessGroupId));
    }

    // verify the update
    verifyUpdatePort(port, remoteProcessGroupPortDto);

    // perform the update
    updatePort(port, remoteProcessGroupPortDto, remoteProcessGroup);
    remoteProcessGroup.getProcessGroup().onComponentModified();

    return port;
}
 
Example 2
Source File: StandardRemoteProcessGroupDAO.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
@Override
public void verifyUpdateOutputPort(String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) {
    final RemoteProcessGroup remoteProcessGroup = locateRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort port = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());

    if (port == null) {
        throw new ResourceNotFoundException(
                String.format("Unable to find remote process group output port with id '%s'.", remoteProcessGroupPortDto.getId()));
    }

    verifyUpdatePort(port, remoteProcessGroupPortDto);
}
 
Example 3
Source File: StandardRemoteProcessGroupDAO.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
@Override
public RemoteGroupPort updateRemoteProcessGroupOutputPort(String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) {
    final RemoteProcessGroup remoteProcessGroup = locateRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort port = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());

    if (port == null) {
        throw new ResourceNotFoundException(
                String.format("Unable to find remote process group output port with id '%s'.", remoteProcessGroupId));
    }

    // verify the update
    verifyUpdatePort(port, remoteProcessGroupPortDto);

    // perform the update
    if (isNotNull(remoteProcessGroupPortDto.getConcurrentlySchedulableTaskCount())) {
        port.setMaxConcurrentTasks(remoteProcessGroupPortDto.getConcurrentlySchedulableTaskCount());
    }
    if (isNotNull(remoteProcessGroupPortDto.getUseCompression())) {
        port.setUseCompression(remoteProcessGroupPortDto.getUseCompression());
    }

    final Boolean isTransmitting = remoteProcessGroupPortDto.isTransmitting();
    if (isNotNull(isTransmitting)) {
        // start or stop as necessary
        if (!port.isRunning() && isTransmitting) {
            remoteProcessGroup.startTransmitting(port);
        } else if (port.isRunning() && !isTransmitting) {
            remoteProcessGroup.stopTransmitting(port);
        }
    }

    return port;
}
 
Example 4
Source File: RemoteProcessGroupAuditor.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
/**
 * Audits the update of remote process group output port configuration.
 *
 * @param proceedingJoinPoint join point
 * @param remoteProcessGroupPortDto dto
 * @param remoteProcessGroupDAO dao
 * @return group
 * @throws Throwable ex
 */
@Around("within(org.apache.nifi.web.dao.RemoteProcessGroupDAO+) && "
        + "execution(org.apache.nifi.remote.RemoteGroupPort updateRemoteProcessGroupOutputPort(java.lang.String, org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO)) && "
        + "args(remoteProcessGroupId, remoteProcessGroupPortDto) && "
        + "target(remoteProcessGroupDAO)")
public RemoteGroupPort auditUpdateProcessGroupOutputPortConfiguration(
        ProceedingJoinPoint proceedingJoinPoint, String remoteProcessGroupId,
        RemoteProcessGroupPortDTO remoteProcessGroupPortDto, RemoteProcessGroupDAO remoteProcessGroupDAO) throws Throwable {

    final RemoteProcessGroup remoteProcessGroup = remoteProcessGroupDAO.getRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort remoteProcessGroupPort = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());

    return auditUpdateProcessGroupPortConfiguration(proceedingJoinPoint, remoteProcessGroupPortDto, remoteProcessGroup, remoteProcessGroupPort);
}
 
Example 5
Source File: StandardRemoteProcessGroupDAO.java    From nifi with Apache License 2.0 5 votes vote down vote up
@Override
public void verifyUpdateOutputPort(String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) {
    final RemoteProcessGroup remoteProcessGroup = locateRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort port = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());

    if (port == null) {
        throw new ResourceNotFoundException(
                String.format("Unable to find remote process group output port with id '%s'.", remoteProcessGroupPortDto.getId()));
    }

    verifyUpdatePort(port, remoteProcessGroupPortDto);
}
 
Example 6
Source File: RemoteProcessGroupAuditor.java    From nifi with Apache License 2.0 5 votes vote down vote up
/**
 * Audits the update of remote process group output port configuration.
 *
 * @param proceedingJoinPoint join point
 * @param remoteProcessGroupPortDto dto
 * @param remoteProcessGroupDAO dao
 * @return group
 * @throws Throwable ex
 */
@Around("within(org.apache.nifi.web.dao.RemoteProcessGroupDAO+) && "
        + "execution(org.apache.nifi.remote.RemoteGroupPort updateRemoteProcessGroupOutputPort(java.lang.String, org.apache.nifi.web.api.dto.RemoteProcessGroupPortDTO)) && "
        + "args(remoteProcessGroupId, remoteProcessGroupPortDto) && "
        + "target(remoteProcessGroupDAO)")
public RemoteGroupPort auditUpdateProcessGroupOutputPortConfiguration(
        ProceedingJoinPoint proceedingJoinPoint, String remoteProcessGroupId,
        RemoteProcessGroupPortDTO remoteProcessGroupPortDto, RemoteProcessGroupDAO remoteProcessGroupDAO) throws Throwable {

    final RemoteProcessGroup remoteProcessGroup = remoteProcessGroupDAO.getRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort remoteProcessGroupPort = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());

    return auditUpdateProcessGroupPortConfiguration(proceedingJoinPoint, remoteProcessGroupPortDto, remoteProcessGroup, remoteProcessGroupPort);
}