@Override public VertexRef unmarshal(VertexRefJaxbEntry input) throws Exception { if (input == null) { return null; } final VertexRef ref = new DefaultVertexRef(input.namespace, input.id, input.label); return ref; } }
@Override public String toString() { return "VertexRef:"+getNamespace()+":"+getId(); }
@Override public VertexRef unmarshal(VertexRefJaxbEntry input) throws Exception { if (input == null) { return null; } final VertexRef ref = new DefaultVertexRef(input.namespace, input.id, input.label); return ref; } }
@Override public String toString() { return "VertexRef:"+getNamespace()+":"+getId(); }
@Override public Set<VertexRef> unmarshal(VertexRefSetAdapter.VertexRefSet v) throws Exception { if (v == null) { return null; } else { Set<VertexRef> retval = new HashSet<VertexRef>(); for (VertexRefEntry entry : v.entry) { VertexRef ref = new DefaultVertexRef(entry.namespace, entry.id, entry.label); retval.add(ref); } return retval; } } }
@Override public String toString() { return "VertexRef:"+getNamespace()+":"+getId(); }
@Override public Vertex getVertex(String namespace, String id) { return getVertex(new DefaultVertexRef(namespace, id)); }
@Override public Vertex getVertex(String namespace, String id) { return getVertex(new DefaultVertexRef(namespace, id)); }
@Override public Vertex getVertex(String namespace, String id) { return getVertex(new DefaultVertexRef(namespace, id)); }
@Override public Map<VertexRef,Point> unmarshal(VertexRefPointMapAdapter.VertexRefPointMap v) throws Exception { if (v == null) { return null; } else { Map<VertexRef, Point> retval = new HashMap<VertexRef, Point>(); for (VertexRefPointEntry entry : v.entry) { VertexRef ref = new DefaultVertexRef(entry.key.namespace, entry.key.id, entry.key.label); Point point = new Point(entry.value.x, entry.value.y); retval.put(ref, point); } return retval; } } }
@Override public Map<VertexRef,Point> unmarshal(VertexRefPointMapAdapter.VertexRefPointMap v) throws Exception { if (v == null) { return null; } else { Map<VertexRef, Point> retval = new HashMap<VertexRef, Point>(); for (VertexRefPointEntry entry : v.entry) { VertexRef ref = new DefaultVertexRef(entry.key.namespace, entry.key.id, entry.key.label); Point point = new Point(entry.value.x, entry.value.y); retval.put(ref, point); } return retval; } } }
@Override public Map<VertexRef,Point> unmarshal(VertexRefPointMapAdapter.VertexRefPointMap v) throws Exception { if (v == null) { return null; } else { Map<VertexRef, Point> retval = new HashMap<VertexRef, Point>(); for (VertexRefPointEntry entry : v.entry) { VertexRef ref = new DefaultVertexRef(entry.key.namespace, entry.key.id, entry.key.label); Point point = new Point(entry.value.x, entry.value.y); retval.put(ref, point); } return retval; } } }
@Deprecated @Override public boolean containsVertexId(String id) { return containsVertexId(new DefaultVertexRef(getNamespace(), id)); }
@Deprecated @Override public boolean containsVertexId(String id) { return containsVertexId(new DefaultVertexRef(getNamespace(), id)); }
@Deprecated @Override public boolean containsVertexId(String id) { return containsVertexId(new DefaultVertexRef(getVertexNamespace(), id)); }
/** * @deprecated You should search by the namespace and ID tuple instead */ @Override public boolean containsVertexId(String id) { return containsVertexId(new DefaultVertexRef(getNamespace(), id)); }
@Override public void addVertexHopCriteria(SearchResult searchResult, GraphContainer container) { LOG.debug("SimpleSearchProvider->addVertexHopCriteria: called with search result: '{}'", searchResult); final DefaultVertexHopCriteria criterion = new DefaultVertexHopCriteria( new DefaultVertexRef( searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel())); container.addCriteria(criterion); LOG.debug("SimpleSearchProvider->addVertexHop: adding hop criteria {}.", criterion); LOG.debug("SimpleSearchProvider->addVertexHop: current criteria {}.", Arrays.toString(container.getCriteria())); }
@Override public void addVertexHopCriteria(SearchResult searchResult, GraphContainer container) { LOG.debug("ApplicationServiceSearchProvider->addVertexHopCriteria: called with search result: '{}'", searchResult); VertexHopGraphProvider.DefaultVertexHopCriteria criterion = new VertexHopGraphProvider.DefaultVertexHopCriteria(new DefaultVertexRef(searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel())); container.addCriteria(criterion); LOG.debug("ApplicationServiceSearchProvider->addVertexHop: adding hop criteria {}.", criterion); LOG.debug("ApplicationServiceSearchProvider->addVertexHop: current criteria {}.", Arrays.toString(container.getCriteria())); }
/** * Returns true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. * @param generatedId The generated id * @return true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. */ @SuppressWarnings("deprecation") private boolean isValid(String generatedId) { return !provider.containsVertexId(new DefaultVertexRef(provider.getVertexNamespace(), generatedId)); }
@Override public void removeVertexHopCriteria(SearchResult searchResult, GraphContainer container) { LOG.debug("SimpleSearchProvider->removeVertexHopCriteria: called with search result: '{}'", searchResult); final DefaultVertexHopCriteria criterion = new DefaultVertexHopCriteria( new DefaultVertexRef( searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel())); container.removeCriteria(criterion); LOG.debug("SimpleSearchProvider->removeVertexHopCriteria: current criteria {}.", Arrays.toString(container.getCriteria())); } }