if (isNotNull(remoteProcessGroupDTO.getYieldDuration())) { Matcher yieldMatcher = FormatUtils.TIME_DURATION_PATTERN.matcher(remoteProcessGroupDTO.getYieldDuration()); if (!yieldMatcher.matches()) { validationErrors.add("Yield duration is not a valid time duration (ie 30 sec, 5 min)");
/** * Verifies the specified remote group can be updated, if necessary. */ @SuppressWarnings("unchecked") private void verifyUpdate(RemoteProcessGroup remoteProcessGroup, RemoteProcessGroupDTO remoteProcessGroupDto) { // see if the remote process group can start/stop transmitting if (isNotNull(remoteProcessGroupDto.isTransmitting())) { if (!remoteProcessGroup.isTransmitting() && remoteProcessGroupDto.isTransmitting()) { remoteProcessGroup.verifyCanStartTransmitting(); } else if (remoteProcessGroup.isTransmitting() && !remoteProcessGroupDto.isTransmitting()) { remoteProcessGroup.verifyCanStopTransmitting(); } } // validate the proposed configuration final List<String> requestValidation = validateProposedRemoteProcessGroupConfiguration(remoteProcessGroupDto); // ensure there was no validation errors if (!requestValidation.isEmpty()) { throw new ValidationException(requestValidation); } // if any remote group properties are changing, verify update if (isAnyNotNull(remoteProcessGroupDto.getYieldDuration(), remoteProcessGroupDto.getLocalNetworkInterface(), remoteProcessGroupDto.getCommunicationsTimeout(), remoteProcessGroupDto.getProxyHost(), remoteProcessGroupDto.getProxyPort(), remoteProcessGroupDto.getProxyUser(), remoteProcessGroupDto.getProxyPassword())) { remoteProcessGroup.verifyCanUpdate(); } }
copy.setId(original.getId()); copy.setCommunicationsTimeout(original.getCommunicationsTimeout()); copy.setYieldDuration(original.getYieldDuration()); copy.setName(original.getName()); copy.setInputPortCount(original.getInputPortCount());
final String comments = remoteProcessGroupDTO.getComments(); final String communicationsTimeout = remoteProcessGroupDTO.getCommunicationsTimeout(); final String yieldDuration = remoteProcessGroupDTO.getYieldDuration(); final String proxyHost = remoteProcessGroupDTO.getProxyHost(); final Integer proxyPort = remoteProcessGroupDTO.getProxyPort();
remoteGroup.setCommunicationsTimeout(remoteGroupDto.getCommunicationsTimeout()); if (remoteGroupDto.getYieldDuration() != null) { remoteGroup.setYieldDuration(remoteGroupDto.getYieldDuration());
remoteGroup.setPosition(toPosition(remoteGroupDTO.getPosition())); remoteGroup.setCommunicationsTimeout(remoteGroupDTO.getCommunicationsTimeout()); remoteGroup.setYieldDuration(remoteGroupDTO.getYieldDuration()); if (!topLevel) { remoteGroup.setVersionedComponentId(remoteGroupDTO.getVersionedComponentId());
map.put(CommonPropertyKeys.YIELD_PERIOD_KEY, remoteProcessGroupDTO.getYieldDuration()); map.put(RemoteProcessGroupSchema.TRANSPORT_PROTOCOL_KEY, remoteProcessGroupDTO.getTransportProtocol()); map.put(RemoteProcessGroupSchema.PROXY_HOST_KEY, remoteProcessGroupDTO.getProxyHost());
map.put(CommonPropertyKeys.YIELD_PERIOD_KEY, remoteProcessGroupDTO.getYieldDuration()); map.put(RemoteProcessGroupSchema.TRANSPORT_PROTOCOL_KEY, remoteProcessGroupDTO.getTransportProtocol()); map.put(RemoteProcessGroupSchema.PROXY_HOST_KEY, remoteProcessGroupDTO.getProxyHost());