X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=aai-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Faai%2Fquery%2Fbuilder%2FQueryBuilder.java;h=565e8682413a8cfb87ca687aae8d9a0000bff367;hb=a93b19450f6fb966afa1c30a6795e8e670d2aee7;hp=a9fa7cab57a5407cab3d789d0cc597ffe705e1c1;hpb=c2fddaed33f9f7bbec3feca7bf905f0a1e56b3ed;p=aai%2Faai-common.git diff --git a/aai-core/src/main/java/org/openecomp/aai/query/builder/QueryBuilder.java b/aai-core/src/main/java/org/openecomp/aai/query/builder/QueryBuilder.java index a9fa7cab..565e8682 100644 --- a/aai-core/src/main/java/org/openecomp/aai/query/builder/QueryBuilder.java +++ b/aai-core/src/main/java/org/openecomp/aai/query/builder/QueryBuilder.java @@ -29,6 +29,7 @@ import java.util.List; import javax.ws.rs.core.MultivaluedMap; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.openecomp.aai.exceptions.AAIException; @@ -42,7 +43,7 @@ import org.openecomp.aai.serialization.db.exceptions.NoEdgeRuleFoundException; /** * The Class QueryBuilder. */ -public abstract class QueryBuilder implements Iterator { +public abstract class QueryBuilder implements Iterator { protected QueryParserStrategy factory = null; @@ -82,7 +83,7 @@ public abstract class QueryBuilder implements Iterator { * @param value the value * @return the vertices by indexed property */ - public abstract QueryBuilder getVerticesByIndexedProperty(String key, Object value); + public abstract QueryBuilder getVerticesByIndexedProperty(String key, Object value); /** * Gets the vertices by property. @@ -91,7 +92,7 @@ public abstract class QueryBuilder implements Iterator { * @param value the value * @return the vertices by property */ - public abstract QueryBuilder getVerticesByProperty(String key, Object value); + public abstract QueryBuilder getVerticesByProperty(String key, Object value); /** * filters by all the values for this property @@ -99,7 +100,7 @@ public abstract class QueryBuilder implements Iterator { * @param values * @return vertices that match these values */ - public abstract QueryBuilder getVerticesByIndexedProperty(String key, List values); + public abstract QueryBuilder getVerticesByIndexedProperty(String key, List values); /** * filters by all the values for this property @@ -107,7 +108,7 @@ public abstract class QueryBuilder implements Iterator { * @param values * @return vertices that match these values */ - public abstract QueryBuilder getVerticesByProperty(String key, List values); + public abstract QueryBuilder getVerticesByProperty(String key, List values); /** * Gets the child vertices from parent. @@ -117,7 +118,7 @@ public abstract class QueryBuilder implements Iterator { * @param childType the child type * @return the child vertices from parent */ - public abstract QueryBuilder getChildVerticesFromParent(String parentKey, String parentValue, String childType); + public abstract QueryBuilder getChildVerticesFromParent(String parentKey, String parentValue, String childType); /** * Gets the typed vertices by map. @@ -126,7 +127,7 @@ public abstract class QueryBuilder implements Iterator { * @param map the map * @return the typed vertices by map */ - public abstract QueryBuilder getTypedVerticesByMap(String type, LinkedHashMap map); + public abstract QueryBuilder getTypedVerticesByMap(String type, LinkedHashMap map); /** * Creates the DB query. @@ -134,7 +135,7 @@ public abstract class QueryBuilder implements Iterator { * @param obj the obj * @return the query builder */ - public abstract QueryBuilder createDBQuery(Introspector obj); + public abstract QueryBuilder createDBQuery(Introspector obj); /** * Creates the key query. @@ -142,7 +143,7 @@ public abstract class QueryBuilder implements Iterator { * @param obj the obj * @return the query builder */ - public abstract QueryBuilder createKeyQuery(Introspector obj); + public abstract QueryBuilder createKeyQuery(Introspector obj); /** * Creates the container query. @@ -150,7 +151,7 @@ public abstract class QueryBuilder implements Iterator { * @param obj the obj * @return the query builder */ - public abstract QueryBuilder createContainerQuery(Introspector obj); + public abstract QueryBuilder createContainerQuery(Introspector obj); /** * Creates the edge traversal. @@ -159,7 +160,7 @@ public abstract class QueryBuilder implements Iterator { * @param child the child * @return the query builder */ - public abstract QueryBuilder createEdgeTraversal(EdgeType type, Introspector parent, Introspector child) throws AAIException; + public abstract QueryBuilder createEdgeTraversal(EdgeType type, Introspector parent, Introspector child) throws AAIException; /** * Creates the edge traversal. @@ -168,15 +169,16 @@ public abstract class QueryBuilder implements Iterator { * @param child the child * @return the query builder */ - public abstract QueryBuilder createEdgeTraversal(EdgeType type, Vertex parent, Introspector child) throws AAIException; + public abstract QueryBuilder createEdgeTraversal(EdgeType type, Vertex parent, Introspector child) throws AAIException; - public QueryBuilder createEdgeTraversal(EdgeType type, String outNodeType, String inNodeType) throws NoEdgeRuleFoundException, AAIException { + public QueryBuilder createEdgeTraversal(EdgeType type, String outNodeType, String inNodeType) throws NoEdgeRuleFoundException, AAIException { Introspector out = loader.introspectorFromName(outNodeType); Introspector in = loader.introspectorFromName(inNodeType); return createEdgeTraversal(type, out, in); } - + + public abstract QueryBuilder getEdgesBetween(EdgeType type, String outNodeType, String inNodeType) throws AAIException; /** * Creates the query from URI. * @@ -221,35 +223,35 @@ public abstract class QueryBuilder implements Iterator { * * @return the parent query */ - public abstract QueryBuilder getParentQuery(); + public abstract QueryBuilder getParentQuery(); /** * Gets the query. * * @return the query */ - public abstract T getQuery(); + public abstract E2 getQuery(); /** * Form boundary. */ public abstract void markParentBoundary(); - public abstract QueryBuilder limit(long amount); + public abstract QueryBuilder limit(long amount); /** * New instance. * * @param start the start * @return the query builder */ - public abstract QueryBuilder newInstance(Vertex start); + public abstract QueryBuilder newInstance(Vertex start); /** * New instance. * * @return the query builder */ - public abstract QueryBuilder newInstance(); + public abstract QueryBuilder newInstance(); /** * Gets the start. @@ -272,7 +274,7 @@ public abstract class QueryBuilder implements Iterator { * @param obj * @return */ - public abstract QueryBuilder exactMatchQuery(Introspector obj); + public abstract QueryBuilder exactMatchQuery(Introspector obj); /** * lets you join any number of QueryBuilders @@ -280,14 +282,14 @@ public abstract class QueryBuilder implements Iterator { * @param builder * @return */ - public abstract QueryBuilder union(QueryBuilder[] builder); + public abstract QueryBuilder union(QueryBuilder... builder); - public abstract QueryBuilder where(QueryBuilder[] builder); + public abstract QueryBuilder where(QueryBuilder... builder); public abstract void markContainer(); - public abstract QueryBuilder getContainerQuery(); + public abstract QueryBuilder getContainerQuery(); - public abstract List toList(); + public abstract List toList(); }