@Override public void verifyCanDelete() { if (!flowFileQueue.isEmpty()) { throw new IllegalStateException("Queue not empty for " + this.getIdentifier()); } if (source.isRunning()) { if (!ConnectableType.FUNNEL.equals(source.getConnectableType())) { throw new IllegalStateException("Source of Connection (" + source.getIdentifier() + ") is running"); } } final Connectable dest = destination.get(); if (dest.isRunning()) { if (!ConnectableType.FUNNEL.equals(dest.getConnectableType())) { throw new IllegalStateException("Destination of Connection (" + dest.getIdentifier() + ") is running"); } } }
/** * Determines the type of component the specified connectable is. */ private Component determineConnectableType(ConnectableDTO connectable) { Component component = Component.Controller; final String connectableType = connectable.getType(); if (ConnectableType.PROCESSOR.name().equals(connectableType)) { component = Component.Processor; } else if (ConnectableType.INPUT_PORT.name().equals(connectableType)) { component = Component.InputPort; } else if (ConnectableType.OUTPUT_PORT.name().equals(connectableType)) { component = Component.OutputPort; } else if (ConnectableType.FUNNEL.name().equals(connectableType)) { component = Component.Funnel; } else { component = Component.RemoteProcessGroup; } return component; }
if (requestConnection.getDestination() != null && !currentDestination.getIdentifier().equals(requestConnection.getDestination().getId())) { try { final ConnectableType destinationConnectableType = ConnectableType.valueOf(requestConnection.getDestination().getType()); if (ConnectableType.REMOTE_INPUT_PORT.equals(destinationConnectableType)) { newDestinationAuthorizable = lookup.getRemoteProcessGroup(requestConnection.getDestination().getGroupId()); } else { } catch (final IllegalArgumentException e) { throw new IllegalArgumentException(String.format("Unrecognized destination type %s. Excepted values are [%s]", requestConnection.getDestination().getType(), StringUtils.join(ConnectableType.values(), ", ")));
dto.setComponentName(connectable.getName()); } else { dto.setComponentType(connectable.getConnectableType().toString()); dto.setComponentName(dto.getComponentId()); dto.setRelationship(null);
public ConnectableTypeParameter(String rawConnectionType) { try { type = ConnectableType.valueOf(rawConnectionType.toUpperCase()); } catch (IllegalArgumentException pe) { throw new IllegalArgumentException(String.format(INVALID_CONNECTABLE_TYPE_MESSAGE, rawConnectionType)); } }
if (proposedDestination != null && ConnectableType.REMOTE_INPUT_PORT.name().equals(proposedDestination.getType())) {
@Override public Resource getResource() { final ResourceType resourceType = ConnectableType.REMOTE_INPUT_PORT.equals(getConnectableType()) ? ResourceType.InputPort : ResourceType.OutputPort; return ResourceFactory.getComponentResource(resourceType, getIdentifier(), getName()); }
sourceConnectableType = ConnectableType.valueOf(requestConnection.getSource().getType()); } catch (final IllegalArgumentException e) { throw new IllegalArgumentException(String.format("Unrecognized source type %s. Expected values are [%s]", requestConnection.getSource().getType(), StringUtils.join(ConnectableType.values(), ", "))); destinationConnectableType = ConnectableType.valueOf(requestConnection.getDestination().getType()); } catch (final IllegalArgumentException e) { throw new IllegalArgumentException(String.format("Unrecognized destination type %s. Expected values are [%s]", requestConnection.getDestination().getType(), StringUtils.join(ConnectableType.values(), ", "))); if (ConnectableType.REMOTE_OUTPUT_PORT.equals(sourceConnectableType)) { source = lookup.getRemoteProcessGroup(requestConnection.getSource().getGroupId()); } else { if (ConnectableType.REMOTE_INPUT_PORT.equals(destinationConnectableType)) { destination = lookup.getRemoteProcessGroup(requestConnection.getDestination().getGroupId()); } else {
.filter(connectable -> connectable.getType().equals(ConnectableType.REMOTE_OUTPUT_PORT.toString()) || connectable.getType().equals(ConnectableType.REMOTE_INPUT_PORT.toString())) .forEach(connectable -> connectable.setId(Optional.ofNullable(rpgIdToTargetIdMap.get(connectable.getId())).orElse(connectable.getId())));
if (ConnectableType.REMOTE_OUTPUT_PORT.name().equals(sourceDto.getType())) { final ProcessGroup sourceParentGroup = locateProcessGroup(flowController, groupId); if (ConnectableType.REMOTE_INPUT_PORT.name().equals(destinationDto.getType())) { final ProcessGroup destinationParentGroup = locateProcessGroup(flowController, groupId);
@Override public Resource getResource() { final ResourceType resourceType = ConnectableType.INPUT_PORT.equals(getConnectableType()) ? ResourceType.InputPort : ResourceType.OutputPort; return ResourceFactory.getComponentResource(resourceType, getIdentifier(), getName()); }
.filter(connectable -> connectable.getType().equals(ConnectableType.REMOTE_OUTPUT_PORT.toString()) || connectable.getType().equals(ConnectableType.REMOTE_INPUT_PORT.toString())) .forEach(connectable -> connectable.setId(Optional.ofNullable(rpgIdToTargetIdMap.get(connectable.getId())).orElse(connectable.getId())));
public ConnectableDTO createConnectableDto(final FunnelDTO funnel) { final ConnectableDTO connectable = new ConnectableDTO(); connectable.setGroupId(funnel.getParentGroupId()); connectable.setId(funnel.getId()); connectable.setType(ConnectableType.FUNNEL.name()); connectable.setVersionedComponentId(funnel.getVersionedComponentId()); return connectable; }
if (ConnectableType.REMOTE_OUTPUT_PORT.equals(source.getConnectableType())) { final RemoteGroupPort remoteOutputPort = (RemoteGroupPort) source; activeThreadCount += processScheduler.getActiveThreadCount(remoteOutputPort); if (ConnectableType.REMOTE_INPUT_PORT.equals(destination.getConnectableType())) { final RemoteGroupPort remoteInputPort = (RemoteGroupPort) destination; activeThreadCount += processScheduler.getActiveThreadCount(remoteInputPort);
public ConnectableDTO createConnectableDto(final PortDTO port, final ConnectableType type) { final ConnectableDTO connectable = new ConnectableDTO(); connectable.setGroupId(port.getParentGroupId()); connectable.setId(port.getId()); connectable.setName(port.getName()); connectable.setType(type.name()); connectable.setVersionedComponentId(port.getVersionedComponentId()); return connectable; }
public RemoteProcessGroupPortDTO createRemoteProcessGroupPortDto(final RemoteGroupPort port) { if (port == null) { return null; } final RemoteProcessGroupPortDTO dto = new RemoteProcessGroupPortDTO(); dto.setId(port.getIdentifier()); dto.setGroupId(port.getRemoteProcessGroup().getIdentifier()); dto.setTargetId(port.getTargetIdentifier()); dto.setName(port.getName()); dto.setComments(port.getComments()); dto.setTransmitting(port.isRunning()); dto.setTargetRunning(port.isTargetRunning()); dto.setConcurrentlySchedulableTaskCount(port.getMaxConcurrentTasks()); dto.setUseCompression(port.isUseCompression()); dto.setExists(port.getTargetExists()); dto.setVersionedComponentId(port.getVersionedComponentId().orElse(null)); final BatchSettingsDTO batchDTO = new BatchSettingsDTO(); batchDTO.setCount(port.getBatchCount()); batchDTO.setSize(port.getBatchSize()); batchDTO.setDuration(port.getBatchDuration()); dto.setBatchSettings(batchDTO); // determine if this port is currently connected to another component locally if (ConnectableType.REMOTE_OUTPUT_PORT.equals(port.getConnectableType())) { dto.setConnected(!port.getConnections().isEmpty()); } else { dto.setConnected(port.hasIncomingConnection()); } return dto; }
public ConnectableDTO createConnectableDto(final RemoteProcessGroupPortDTO remoteGroupPort, final ConnectableType type) { final ConnectableDTO connectable = new ConnectableDTO(); connectable.setGroupId(remoteGroupPort.getGroupId()); connectable.setId(remoteGroupPort.getId()); connectable.setName(remoteGroupPort.getName()); connectable.setType(type.name()); connectable.setVersionedComponentId(connectable.getVersionedComponentId()); return connectable; }
if (ConnectableType.REMOTE_OUTPUT_PORT.equals(source.getConnectableType())) { final RemoteGroupPort remoteOutputPort = (RemoteGroupPort) source; activeGroupThreads += processScheduler.getActiveThreadCount(remoteOutputPort); if (ConnectableType.REMOTE_INPUT_PORT.equals(destination.getConnectableType())) { final RemoteGroupPort remoteInputPort = (RemoteGroupPort) destination; activeGroupThreads += processScheduler.getActiveThreadCount(remoteInputPort);
public ConnectableDTO createConnectableDto(final ProcessorDTO processor) { final ConnectableDTO connectable = new ConnectableDTO(); connectable.setGroupId(processor.getParentGroupId()); connectable.setId(processor.getId()); connectable.setName(processor.getName()); connectable.setType(ConnectableType.PROCESSOR.name()); connectable.setVersionedComponentId(processor.getVersionedComponentId()); return connectable; }