public ConnectableDTO createConnectableDto(final RemoteProcessGroupPortDTO remoteGroupPort, final ConnectableType type) { final ConnectableDTO connectable = new ConnectableDTO(); connectable.setGroupId(remoteGroupPort.getGroupId()); connectable.setId(remoteGroupPort.getId()); connectable.setName(remoteGroupPort.getName()); connectable.setType(type.name()); connectable.setVersionedComponentId(connectable.getVersionedComponentId()); return connectable; }
descriptor.setVersionedComponentId(port.getVersionedComponentId()); descriptor.setTargetId(port.getTargetId()); descriptor.setName(port.getName()); descriptor.setComments(port.getComments()); descriptor.setTargetRunning(port.isTargetRunning());
public AffectedComponentEntity createAffectedComponentEntity(final RemoteProcessGroupPortDTO remotePortDto, final String referenceType, final RemoteProcessGroupEntity rpgEntity) { if (remotePortDto == null) { return null; } final AffectedComponentEntity component = new AffectedComponentEntity(); component.setId(remotePortDto.getId()); component.setPermissions(rpgEntity.getPermissions()); component.setRevision(rpgEntity.getRevision()); component.setUri(rpgEntity.getUri()); final AffectedComponentDTO componentDto = new AffectedComponentDTO(); componentDto.setId(remotePortDto.getId()); componentDto.setName(remotePortDto.getName()); componentDto.setProcessGroupId(remotePortDto.getGroupId()); componentDto.setReferenceType(referenceType); componentDto.setState(remotePortDto.isTransmitting() ? "Running" : "Stopped"); component.setComponent(componentDto); return component; }
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; }
@Override public RemotePortSchema apply(RemoteProcessGroupPortDTO remoteProcessGroupPortDTO) { Map<String, Object> map = new HashMap<>(); // If a targetId is specified, it takes precedence over the original id final String targetId = remoteProcessGroupPortDTO.getTargetId(); map.put(ID_KEY, StringUtils.isNotBlank(targetId) ? targetId : remoteProcessGroupPortDTO.getId()); map.put(NAME_KEY, remoteProcessGroupPortDTO.getName()); map.put(CommonPropertyKeys.COMMENT_KEY, remoteProcessGroupPortDTO.getComments()); map.put(CommonPropertyKeys.MAX_CONCURRENT_TASKS_KEY, remoteProcessGroupPortDTO.getConcurrentlySchedulableTaskCount()); map.put(CommonPropertyKeys.USE_COMPRESSION_KEY, remoteProcessGroupPortDTO.getUseCompression()); return new RemotePortSchema(map); } }
@Override public RemotePortSchema apply(RemoteProcessGroupPortDTO remoteProcessGroupPortDTO) { Map<String, Object> map = new HashMap<>(); // If a targetId is specified, it takes precedence over the original id final String targetId = remoteProcessGroupPortDTO.getTargetId(); map.put(ID_KEY, StringUtils.isNotBlank(targetId) ? targetId : remoteProcessGroupPortDTO.getId()); map.put(NAME_KEY, remoteProcessGroupPortDTO.getName()); map.put(CommonPropertyKeys.COMMENT_KEY, remoteProcessGroupPortDTO.getComments()); map.put(CommonPropertyKeys.MAX_CONCURRENT_TASKS_KEY, remoteProcessGroupPortDTO.getConcurrentlySchedulableTaskCount()); map.put(CommonPropertyKeys.USE_COMPRESSION_KEY, remoteProcessGroupPortDTO.getUseCompression()); return new RemotePortSchema(map); } }