if (proposedDestination != null && ConnectableType.REMOTE_INPUT_PORT.name().equals(proposedDestination.getType())) { if (proposedDestination.getGroupId() == null) { validationErrors.add("When the destination is a remote input port its group id is required."); return validationErrors; final RemoteProcessGroup remoteProcessGroup = destinationParentGroup.getRemoteProcessGroup(proposedDestination.getGroupId()); if (remoteProcessGroup == null) { validationErrors.add("Unable to find the specified remote process group.");
final ProcessGroup sourceParentGroup = locateProcessGroup(flowController, groupId); final RemoteProcessGroup remoteProcessGroup = sourceParentGroup.getRemoteProcessGroup(sourceDto.getGroupId()); if (remoteProcessGroup == null) { throw new IllegalArgumentException("Unable to find the specified remote process group."); final ProcessGroup sourceGroup = locateProcessGroup(flowController, sourceDto.getGroupId()); final Connectable sourceConnectable = sourceGroup.getConnectable(sourceDto.getId()); if (sourceConnectable == null) { final ProcessGroup destinationParentGroup = locateProcessGroup(flowController, groupId); final RemoteProcessGroup remoteProcessGroup = destinationParentGroup.getRemoteProcessGroup(destinationDto.getGroupId()); if (remoteProcessGroup == null) { throw new IllegalArgumentException("Unable to find the specified remote process group."); final ProcessGroup destinationGroup = locateProcessGroup(flowController, destinationDto.getGroupId()); final Connectable destinationConnectable = destinationGroup.getConnectable(destinationDto.getId()); if (destinationConnectable == null) {
if (proposedDestination.getGroupId() == null) { throw new IllegalArgumentException("When the destination is a remote input port its group id is required."); if (currentDestination.getConnectableType() == ConnectableType.REMOTE_INPUT_PORT) { RemoteGroupPort remotePort = (RemoteGroupPort) currentDestination; if (!proposedDestination.getGroupId().equals(remotePort.getRemoteProcessGroup().getIdentifier())) { isDifferentRemoteProcessGroup = true; final RemoteProcessGroup remoteProcessGroup = destinationParentGroup.getRemoteProcessGroup(proposedDestination.getGroupId()); if (proposedDestination.getGroupId() == null) { proposedDestination.setGroupId(group.getIdentifier()); final ProcessGroup destinationGroup = locateProcessGroup(flowController, proposedDestination.getGroupId()); newDestination = destinationGroup.getConnectable(proposedDestination.getId());
if (sourceConnectableDTO.getGroupId() == null) { sourceConnectableDTO.setGroupId(groupId); if (destinationConnectableDTO.getGroupId() == null) { destinationConnectableDTO.setGroupId(groupId); if (ConnectableType.REMOTE_OUTPUT_PORT.name().equals(sourceConnectableDTO.getType())) { final ProcessGroup sourceParentGroup = locateProcessGroup(flowController, groupId); final RemoteProcessGroup remoteProcessGroup = sourceParentGroup.getRemoteProcessGroup(sourceConnectableDTO.getGroupId()); source = remoteProcessGroup.getOutputPort(sourceConnectableDTO.getId()); } else { final ProcessGroup sourceGroup = locateProcessGroup(flowController, sourceConnectableDTO.getGroupId()); source = sourceGroup.getConnectable(sourceConnectableDTO.getId()); if (ConnectableType.REMOTE_INPUT_PORT.name().equals(destinationConnectableDTO.getType())) { final ProcessGroup destinationParentGroup = locateProcessGroup(flowController, groupId); final RemoteProcessGroup remoteProcessGroup = destinationParentGroup.getRemoteProcessGroup(destinationConnectableDTO.getGroupId()); destination = remoteProcessGroup.getInputPort(destinationConnectableDTO.getId()); } else { final ProcessGroup destinationGroup = locateProcessGroup(flowController, destinationConnectableDTO.getGroupId()); destination = destinationGroup.getConnectable(destinationConnectableDTO.getId());
id = new UUID(this.generateMsb(cdto.getGroupId()), LSB); cdto.setGroupId(id.toString()); id = new UUID(this.generateMsb(cdto.getGroupId()), LSB); cdto.setGroupId(id.toString()); } else if (componentDto instanceof ProcessGroupDTO) {
newDestinationAuthorizable = lookup.getRemoteProcessGroup(requestConnection.getDestination().getGroupId()); } else { newDestinationAuthorizable = lookup.getLocalConnectable(requestConnection.getDestination().getId());
source = lookup.getRemoteProcessGroup(requestConnection.getSource().getGroupId()); } else { source = lookup.getLocalConnectable(requestConnection.getSource().getId()); destination = lookup.getRemoteProcessGroup(requestConnection.getDestination().getGroupId()); } else { destination = lookup.getLocalConnectable(requestConnection.getDestination().getId());
public ConnectionEntity createConnectionEntity(final ConnectionDTO dto, final RevisionDTO revision, final PermissionsDTO permissions, final ConnectionStatusDTO status) { final ConnectionEntity entity = new ConnectionEntity(); entity.setRevision(revision); if (dto != null) { entity.setPermissions(permissions); entity.setStatus(status); entity.setId(dto.getId()); entity.setPosition(dto.getPosition()); entity.setBends(dto.getBends()); entity.setLabelIndex(dto.getLabelIndex()); entity.setzIndex(dto.getzIndex()); entity.setSourceId(dto.getSource().getId()); entity.setSourceGroupId(dto.getSource().getGroupId()); entity.setSourceType(dto.getSource().getType()); entity.setDestinationId(dto.getDestination().getId()); entity.setDestinationGroupId(dto.getDestination().getGroupId()); entity.setDestinationType(dto.getDestination().getType()); if (permissions != null && permissions.getCanRead()) { entity.setComponent(dto); } } return entity; }
final ConnectionDTO cp = dtoFactory.copy(connectionDTO); final ConnectableDTO source = connectableMap.get(cp.getSource().getGroupId() + "-" + cp.getSource().getId()); final ConnectableDTO destination = connectableMap.get(cp.getDestination().getGroupId() + "-" + cp.getDestination().getId());
final ConnectableDTO sourceDto = dto.getSource(); if (ConnectableType.REMOTE_OUTPUT_PORT.name().equals(sourceDto.getType())) { final RemoteProcessGroup remoteGroup = processGroup.getRemoteProcessGroup(sourceDto.getGroupId()); source = remoteGroup.getOutputPort(sourceDto.getId()); } else { final ProcessGroup sourceGroup = flowManager.getGroup(sourceDto.getGroupId()); if (sourceGroup == null) { throw new RuntimeException("Found Invalid ProcessGroup ID for Source: " + dto.getSource().getGroupId()); final ConnectableDTO destinationDto = dto.getDestination(); if (ConnectableType.REMOTE_INPUT_PORT.name().equals(destinationDto.getType())) { final RemoteProcessGroup remoteGroup = processGroup.getRemoteProcessGroup(destinationDto.getGroupId()); destination = remoteGroup.getInputPort(destinationDto.getId()); } else { final ProcessGroup destinationGroup = flowManager.getGroup(destinationDto.getGroupId()); if (destinationGroup == null) { throw new RuntimeException("Found Invalid ProcessGroup ID for Destination: " + dto.getDestination().getGroupId());
final RemoteProcessGroup remoteGroup = group.getRemoteProcessGroup(sourceDTO.getGroupId()); source = remoteGroup.getOutputPort(sourceDTO.getId()); } else { final ProcessGroup sourceGroup = getConnectableParent(group, sourceDTO.getGroupId(), flowManager); source = sourceGroup.getConnectable(sourceDTO.getId()); final RemoteProcessGroup remoteGroup = group.getRemoteProcessGroup(destinationDTO.getGroupId()); destination = remoteGroup.getInputPort(destinationDTO.getId()); } else { final ProcessGroup destinationGroup = getConnectableParent(group, destinationDTO.getGroupId(), flowManager); destination = destinationGroup.getConnectable(destinationDTO.getId());