writeLock.lock(); try { if (requireNonNull(port).getTargetExists()) { throw new IllegalStateException("Cannot remove Remote Port " + port.getIdentifier() + " because it still exists on the Remote Instance");
if (sourceConnectable == null) { throw new IllegalArgumentException("The specified source for the connection does not exist"); } else if (!sourceConnectable.getTargetExists()) { throw new IllegalArgumentException("The specified remote output port does not exist."); if (destinationConnectable == null) { throw new IllegalArgumentException("The specified destination for the connection does not exist"); } else if (!destinationConnectable.getTargetExists()) { throw new IllegalArgumentException("The specified remote input port does not exist.");
if (!remoteInputPort.getTargetExists()) { throw new IllegalArgumentException("The specified remote input port does not exist."); } else {
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; }
dto.setRunning(remoteGroupPort.isTargetRunning()); dto.setTransmitting(remoteGroupPort.isRunning()); dto.setExists(remoteGroupPort.getTargetExists()); if (isAuthorized) { dto.setComments(remoteGroup.getComments());
private static List<PortStatus> getPortStatusList(RemoteProcessGroupStatus inputRemoteProcessGroupStatus, FlowController flowController, String rootGroupId, Function<RemoteProcessGroup, Set<RemoteGroupPort>> portFunction) { return portFunction.apply(flowController.getGroup(rootGroupId).getRemoteProcessGroup(inputRemoteProcessGroupStatus.getId())).stream().map(r -> { PortStatus portStatus = new PortStatus(); portStatus.setName(r.getName()); portStatus.setTargetExists(r.getTargetExists()); portStatus.setTargetRunning(r.isTargetRunning()); return portStatus; }).collect(Collectors.toList()); }