.filter(svc -> includeControllerServices || visitedGroupIds.contains(svc.getParentGroupId())) .forEach(svc -> { final String svcGroupId = svc.getParentGroupId(); final String destinationGroupId = contentsByGroup.containsKey(svcGroupId) ? svcGroupId : highestGroupId; svc.setParentGroupId(destinationGroupId);
.filter(svc -> allServicesReferenced.add(svc)) .forEach(svc -> { final String svcGroupId = svc.getParentGroupId(); final String destinationGroupId = contentsByGroup.containsKey(svcGroupId) ? svcGroupId : processGroup.getIdentifier(); svc.setParentGroupId(destinationGroupId);
if (requestControllerService.getParentGroupId() != null && !groupId.equals(requestControllerService.getParentGroupId())) { throw new IllegalArgumentException(String.format("If specified, the parent process group id %s must be the same as specified in the URI %s", requestControllerService.getParentGroupId(), groupId));
if (requestControllerService.getParentGroupId() != null) { throw new IllegalArgumentException("Parent process group ID cannot be specified.");
final String groupId = controllerServiceDTO.getParentGroupId(); if (groupId == null) { flowManager.addRootControllerService(controllerService);
public ControllerServiceEntity createControllerServiceEntity(final ControllerServiceDTO dto, final RevisionDTO revision, final PermissionsDTO permissions, final PermissionsDTO operatePermissions, final List<BulletinEntity> bulletins) { final ControllerServiceEntity entity = new ControllerServiceEntity(); entity.setRevision(revision); if (dto != null) { entity.setPermissions(permissions); entity.setOperatePermissions(operatePermissions); entity.setId(dto.getId()); entity.setParentGroupId(dto.getParentGroupId()); entity.setPosition(dto.getPosition()); final ControllerServiceStatusDTO status = new ControllerServiceStatusDTO(); status.setRunStatus(dto.getState()); status.setValidationStatus(dto.getValidationStatus()); entity.setStatus(status); if (permissions != null && permissions.getCanRead()) { entity.setComponent(dto); entity.setBulletins(bulletins); } } return entity; }
public AffectedComponentEntity createAffectedComponentEntity(final ControllerServiceEntity serviceEntity) { if (serviceEntity == null) { return null; } final AffectedComponentEntity component = new AffectedComponentEntity(); component.setBulletins(serviceEntity.getBulletins()); component.setId(serviceEntity.getId()); component.setPermissions(serviceEntity.getPermissions()); component.setPosition(serviceEntity.getPosition()); component.setRevision(serviceEntity.getRevision()); component.setUri(serviceEntity.getUri()); final ControllerServiceDTO serviceDto = serviceEntity.getComponent(); final AffectedComponentDTO componentDto = new AffectedComponentDTO(); componentDto.setId(serviceDto.getId()); componentDto.setName(serviceDto.getName()); componentDto.setProcessGroupId(serviceDto.getParentGroupId()); componentDto.setReferenceType(AffectedComponentDTO.COMPONENT_TYPE_CONTROLLER_SERVICE); componentDto.setState(serviceDto.getState()); componentDto.setValidationErrors(serviceDto.getValidationErrors()); component.setComponent(componentDto); return component; }
public ControllerServiceDTO copy(final ControllerServiceDTO original) { final ControllerServiceDTO copy = new ControllerServiceDTO(); copy.setAnnotationData(original.getAnnotationData()); copy.setControllerServiceApis(original.getControllerServiceApis()); copy.setComments(original.getComments()); copy.setCustomUiUrl(original.getCustomUiUrl()); copy.setDescriptors(copy(original.getDescriptors())); copy.setId(original.getId()); copy.setParentGroupId(original.getParentGroupId()); copy.setName(original.getName()); copy.setProperties(copy(original.getProperties())); copy.setReferencingComponents(copy(original.getReferencingComponents())); copy.setState(original.getState()); copy.setType(original.getType()); copy.setBundle(copy(original.getBundle())); copy.setExtensionMissing(original.getExtensionMissing()); copy.setMultipleVersionsAvailable(original.getMultipleVersionsAvailable()); copy.setPersistsState(original.getPersistsState()); copy.setValidationErrors(copy(original.getValidationErrors())); copy.setValidationStatus(original.getValidationStatus()); copy.setVersionedComponentId(original.getVersionedComponentId()); return copy; }