package org.onap.aai.query.builder;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.core.MultivaluedMap;
+
import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
import org.onap.aai.parsers.query.QueryParserStrategy;
import org.springframework.context.ApplicationContext;
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
/**
* The Class QueryBuilder.
*/
*/
public abstract QueryBuilder<Vertex> getVerticesByProperty(String key, Object value);
-
/**
* Gets the edges by property.
*
* @throws AAIException
*/
public QueryBuilder<Vertex> createEdgeTraversalWithLabels(MissingOptionalParameter edgeType, String outNodeType,
- String inNodeType, List<String> labels) throws AAIException {
+ String inNodeType, List<String> labels) throws AAIException {
/*
* When no optional parameter edgetype is sent get all edges between the 2 nodetypes
*/
return queryBuilder;
}
- public QueryBuilder<Vertex> createEdgeTraversalWithLabels(String outNodeType, String inNodeType, List<String> labels) throws AAIException {
+ public QueryBuilder<Vertex> createEdgeTraversalWithLabels(String outNodeType, String inNodeType,
+ List<String> labels) throws AAIException {
Introspector out = loader.introspectorFromName(outNodeType);
Introspector in = loader.introspectorFromName(inNodeType);
public abstract QueryBuilder<Vertex> createEdgeTraversalWithLabels(EdgeType type, Introspector out, Introspector in,
List<String> labels) throws AAIException;
-
/**
* This method and it's overloaded counterpart are conditional statements.
* This method creates an edge traversal step if an optional property is present
* This is necessary in cases such as "if the Optional Property 1 is sent,
* find all Nodes of type A with edges to Nodes of type B with property 1,
* otherwise, simply find all nodes of type A".
+ *
* @param type
* @param outNodeType
* @param inNodeType
* @return
* @throws AAIException
*/
- public QueryBuilder<Vertex> createEdgeTraversalIfParameterIsPresent(EdgeType type, String outNodeType, String inNodeType,
- Object value) throws AAIException {
- return this.createEdgeTraversal(type, outNodeType, inNodeType);
+ public QueryBuilder<Vertex> createEdgeTraversalIfParameterIsPresent(EdgeType type, String outNodeType,
+ String inNodeType, Object value) throws AAIException {
+ return this.createEdgeTraversal(type, outNodeType, inNodeType);
}
/**
* This is necessary in cases such as "if the Optional Property 1 is sent,
* find all Nodes of type A with edges to Nodes of type B with property 1,
* otherwise, simply find all nodes of type A".
+ *
* @param type
* @param outNodeType
* @param inNodeType
* @return
* @throws AAIException
*/
- public QueryBuilder<Vertex> createEdgeTraversalIfParameterIsPresent(EdgeType type, String outNodeType, String inNodeType,
- MissingOptionalParameter value) throws AAIException {
- return (QueryBuilder<Vertex>) this;
+ public QueryBuilder<Vertex> createEdgeTraversalIfParameterIsPresent(EdgeType type, String outNodeType,
+ String inNodeType, MissingOptionalParameter value) throws AAIException {
+ return (QueryBuilder<Vertex>) this;
}
/**
return getVerticesByProperty(key, value);
}
- protected abstract void vertexHas(String key, Object value) ;
+ protected abstract void vertexHas(String key, Object value);
protected abstract void vertexHasNot(String key);
protected abstract void vertexHas(String key);
- //TODO: This probably is not required but need to test
+ // TODO: This probably is not required but need to test
// protected abstract void vertexHas(final String key, final P<?> predicate);
}