/** * Creates a remote process group reference. * * @param remoteProcessGroupDTO The remote process group * @return The remote process group */ @Override public RemoteProcessGroup createRemoteProcessGroup(String groupId, RemoteProcessGroupDTO remoteProcessGroupDTO) { ProcessGroup group = locateProcessGroup(flowController, groupId); if (remoteProcessGroupDTO.getParentGroupId() != null && !flowController.getFlowManager().areGroupsSame(groupId, remoteProcessGroupDTO.getParentGroupId())) { throw new IllegalArgumentException("Cannot specify a different Parent Group ID than the Group to which the Remote Process Group is being added."); } final String targetUris = remoteProcessGroupDTO.getTargetUris(); if (targetUris == null || targetUris.length() == 0) { throw new IllegalArgumentException("Cannot add a Remote Process Group without specifying the Target URI(s)"); } // create the remote process group RemoteProcessGroup remoteProcessGroup = flowController.getFlowManager().createRemoteProcessGroup(remoteProcessGroupDTO.getId(), targetUris); remoteProcessGroup.initialize(); // set other properties updateRemoteProcessGroup(remoteProcessGroup, remoteProcessGroupDTO); // get the group to add the remote process group to group.addRemoteProcessGroup(remoteProcessGroup); return remoteProcessGroup; }
if (requestRemoteProcessGroupDTO.getParentGroupId() != null && !groupId.equals(requestRemoteProcessGroupDTO.getParentGroupId())) { throw new IllegalArgumentException(String.format("If specified, the parent process group id %s must be the same as specified in the URI %s", requestRemoteProcessGroupDTO.getParentGroupId(), groupId));
copy.setActiveRemoteOutputPortCount(original.getActiveRemoteOutputPortCount()); copy.setInactiveRemoteOutputPortCount(original.getInactiveRemoteOutputPortCount()); copy.setParentGroupId(original.getParentGroupId()); copy.setTargetUris(original.getTargetUris()); copy.setTransportProtocol(original.getTransportProtocol());