private ApplicationEdgeResponseDTO transform(ApplicationEdge edge) { final ApplicationEdgeResponseDTO response = new ApplicationEdgeResponseDTO(); response.setId(edge.getId()); response.setOperationalStatus(edge.getOperationalStatus()); response.setReductionKeys(edge.getReductionKeys()); response.setMapFunction(transform(edge.getMapFunction())); response.setWeight(edge.getWeight()); response.setApplication(transform(edge.getApplication())); return response; }
@Override public VertexRef visit(final ApplicationEdge edge) { return new ApplicationVertex(edge.getApplication(), 0); } }));
@Override public Void visit(ApplicationEdge edge) { m_typeSelect.setValue(EdgeType.APPLICATION); m_friendlyNameField.setValue(edge.getFriendlyName()); m_ipServiceComponent.setEnabled(false); return null; } });
@Override public boolean addApplicationEdge(BusinessService businessService, Application application, MapFunction mapFunction, int weight) { final BusinessServiceEntity parentEntity = getBusinessServiceEntity(businessService); // Create the edge final ApplicationEdge edge = createEdge(ApplicationEdge.class, businessService, mapFunction, weight); edge.setApplication(application); // if already exists, no update final ApplicationEdgeEntity edgeEntity = getBusinessServiceEdgeEntity(edge); long count = parentEntity.getApplicationEdges().stream().filter(e -> e.equalsDefinition(edgeEntity)).count(); if (count > 0) { return false; } parentEntity.addEdge(((ApplicationEdgeImpl)edge).getEntity()); return true; }
@Override public GraphVertex visit(ApplicationEdge edge) { return m_verticesByApplicationId.get(edge.getApplication().getId()); }
@Override public Void visit(ApplicationEdge edge) { vertexForEdge[0] = new GraphVertexImpl(REDUCE_HIGHEST_SEVERITY, edge.getApplication()); addVertex(vertexForEdge[0]); m_verticesByApplicationId.put(vertexForEdge[0].getApplication().getId(), vertexForEdge[0]); for (IpService ipService : edge.getApplication().getIpServices()) { final GraphVertex ipServiceVertex = new GraphVertexImpl(REDUCE_HIGHEST_SEVERITY, ipService); final GraphEdgeImpl ipVertexEdgeEdge = new GraphEdgeImpl(MAP_IDENTITY); addVertex(ipServiceVertex); m_verticesByIpServiceId.put(ipServiceVertex.getIpService().getId(), ipServiceVertex); addEdge(ipVertexEdgeEdge, vertexForEdge[0], ipServiceVertex); addReductionKeyVerticesToVertex(ipServiceVertex, ipService.getReductionKeys()); } return null; }