throw new IllegalStateException("Cannot remove Remote Port " + port.getIdentifier() + " because it still exists on the Remote Instance"); if (!port.getConnections().isEmpty() || port.hasIncomingConnection()) { throw new IllegalStateException("Cannot remove Remote Port because it is connected to other components");
@Override public boolean isRemoteGroupPortConnected(final String remoteProcessGroupId, final String remotePortId) { final RemoteProcessGroup rpg = remoteProcessGroupDAO.getRemoteProcessGroup(remoteProcessGroupId); RemoteGroupPort port = rpg.getInputPort(remotePortId); if (port != null) { return port.hasIncomingConnection(); } port = rpg.getOutputPort(remotePortId); if (port != null) { return !port.getConnections().isEmpty(); } throw new ResourceNotFoundException("Could not find Port with ID " + remotePortId + " as a child of RemoteProcessGroup with ID " + remoteProcessGroupId); }
for (final Connection connection : port.getConnections()) { connection.verifyCanDelete(); final Set<Connection> copy = new HashSet<>(port.getConnections()); for (final Connection connection : copy) { removeConnection(connection);
if (!port.getConnections().isEmpty()) { addRemoteGroupPort(element, port, "outputPort", scheduledStateLookup);
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; }