final BatchSettingsDTO batchSettingsDTO = remoteProcessGroupPortDTO.getBatchSettings(); if (batchSettingsDTO != null) { final Integer batchCount = batchSettingsDTO.getCount();
/** * Verified the specified remote port can be updated, if necessary. */ private void verifyUpdatePort(RemoteGroupPort port, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) { // see if the remote process group can start/stop transmitting if (isNotNull(remoteProcessGroupPortDto.isTransmitting())) { if (!port.isRunning() && remoteProcessGroupPortDto.isTransmitting()) { port.verifyCanStart(); } else if (port.isRunning() && !remoteProcessGroupPortDto.isTransmitting()) { port.verifyCanStop(); } } // validate the proposed configuration final List<String> requestValidation = validateProposedRemoteProcessGroupPortConfiguration(port, remoteProcessGroupPortDto); // ensure there was no validation errors if (!requestValidation.isEmpty()) { throw new ValidationException(requestValidation); } // verify update when appropriate if (isAnyNotNull(remoteProcessGroupPortDto.getConcurrentlySchedulableTaskCount(), remoteProcessGroupPortDto.getUseCompression(), remoteProcessGroupPortDto.getBatchSettings())) { port.verifyCanUpdate(); } }
descriptor.setTransmitting(port.isTransmitting()); descriptor.setUseCompression(port.getUseCompression()); final BatchSettingsDTO batchSettings = port.getBatchSettings(); if (batchSettings != null) { descriptor.setBatchCount(batchSettings.getCount());
/** * * @param port Port instance to be updated. * @param remoteProcessGroupPortDto DTO containing updated remote process group port settings. * @param remoteProcessGroup If remoteProcessGroupPortDto has updated isTransmitting input, * this method will start or stop the port in this remoteProcessGroup as necessary. */ private void updatePort(RemoteGroupPort port, RemoteProcessGroupPortDTO remoteProcessGroupPortDto, RemoteProcessGroup remoteProcessGroup) { if (isNotNull(remoteProcessGroupPortDto.getConcurrentlySchedulableTaskCount())) { port.setMaxConcurrentTasks(remoteProcessGroupPortDto.getConcurrentlySchedulableTaskCount()); } if (isNotNull(remoteProcessGroupPortDto.getUseCompression())) { port.setUseCompression(remoteProcessGroupPortDto.getUseCompression()); } final BatchSettingsDTO batchSettingsDTO = remoteProcessGroupPortDto.getBatchSettings(); if (isNotNull(batchSettingsDTO)) { port.setBatchCount(batchSettingsDTO.getCount()); port.setBatchSize(batchSettingsDTO.getSize()); port.setBatchDuration(batchSettingsDTO.getDuration()); } 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); } } }
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; }