private RemoteProcessGroupPortDTO createPortDTOWithDesiredRunStatus(final String portId, final String groupId, final RemotePortRunStatusEntity entity) { final RemoteProcessGroupPortDTO dto = new RemoteProcessGroupPortDTO(); dto.setId(portId); dto.setGroupId(groupId); dto.setTransmitting(shouldTransmit(entity)); return dto; }
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; }
if (contents != null && contents.getInputPorts() != null) { for (final RemoteProcessGroupPortDTO remotePort : contents.getInputPorts()) { remotePort.setGroupId(cp.getId()); final String originalId = remotePort.getId(); if (remotePort.getTargetId() == null) { remotePort.setGroupId(cp.getId()); final String originalId = remotePort.getId(); if (remotePort.getTargetId() == null) {
public RemoteProcessGroupPortDTO copy(final RemoteProcessGroupPortDTO original) { final RemoteProcessGroupPortDTO copy = new RemoteProcessGroupPortDTO(); copy.setId(original.getId()); copy.setTargetId(original.getTargetId()); copy.setGroupId(original.getGroupId()); copy.setName(original.getName()); copy.setComments(original.getComments()); copy.setConnected(original.isConnected()); copy.setTargetRunning(original.isTargetRunning()); copy.setTransmitting(original.isTransmitting()); copy.setConcurrentlySchedulableTaskCount(original.getConcurrentlySchedulableTaskCount()); copy.setUseCompression(original.getUseCompression()); copy.setExists(original.getExists()); copy.setVersionedComponentId(original.getVersionedComponentId()); final BatchSettingsDTO batchOrg = original.getBatchSettings(); if (batchOrg != null) { final BatchSettingsDTO batchCopy = new BatchSettingsDTO(); batchCopy.setCount(batchOrg.getCount()); batchCopy.setSize(batchOrg.getSize()); batchCopy.setDuration(batchOrg.getDuration()); copy.setBatchSettings(batchCopy); } return copy; }