summaryrefslogtreecommitdiffstats
path: root/verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java
diff options
context:
space:
mode:
Diffstat (limited to 'verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java')
-rw-r--r--verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java b/verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java
new file mode 100644
index 0000000..d9e006e
--- /dev/null
+++ b/verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Politecnico di Torino and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Apache License, Version 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *******************************************************************************/
+package it.polito.neo4j.manager;
+
+import java.util.Set;
+
+import org.neo4j.graphdb.Label;
+import org.neo4j.graphdb.RelationshipType;
+
+import it.polito.neo4j.jaxb.Graph;
+import it.polito.neo4j.jaxb.Graphs;
+import it.polito.neo4j.jaxb.Neighbour;
+import it.polito.neo4j.jaxb.Paths;
+import it.polito.neo4j.exceptions.DuplicateNodeException;
+import it.polito.neo4j.exceptions.MyInvalidIdException;
+import it.polito.neo4j.exceptions.MyInvalidObjectException;
+import it.polito.neo4j.exceptions.MyNotFoundException;
+
+public interface Neo4jDBInteraction {
+ public enum NodeType implements Label
+ {
+ Nffg, Node, Firewall, EndHost, EndPoint, Antispam, Cache, DPI, Mailclient, Mailserver, NAT, VPNAccess, VPNExit, Webclient, Webserver, Configuration, Fieldmodifier;
+ }
+ public enum RelationType implements RelationshipType
+ {
+ PathRelationship, OwnerRelationship, ConfigurationRelantionship, ElementRelationship;
+ }
+
+ public void createGraphs(Graphs graphs) throws MyNotFoundException, MyInvalidIdException;
+ public Graph createGraph(Graph graph) throws MyNotFoundException, MyInvalidIdException;
+ public it.polito.neo4j.jaxb.Node createNode(it.polito.neo4j.jaxb.Node node, long graphId) throws MyNotFoundException, DuplicateNodeException, MyInvalidIdException;
+ public Neighbour createNeighbour(Neighbour neighbour, long graphId, long nodeId) throws MyNotFoundException;
+
+ public Graphs getGraphs();
+ public Graph getGraph(long id) throws MyNotFoundException;
+ public Set<it.polito.neo4j.jaxb.Node> getNodes(long graphId) throws MyNotFoundException;
+ public it.polito.neo4j.jaxb.Node getNode(long graphId, long nodeId) throws MyNotFoundException;
+ public Set<Neighbour> getNeighbours(long graphId, long nodeId) throws MyNotFoundException;
+ public Neighbour getNeighbour(long graphId, long nodeId, long neighbourId) throws MyNotFoundException;
+
+ public void deleteGraph(long id) throws MyNotFoundException;
+ public void deleteNode(long graphId, long nodeId) throws MyNotFoundException;
+ public void deleteNeighbour(long graphId, long nodeId, long neighbourId) throws MyNotFoundException;
+
+ public it.polito.neo4j.jaxb.Node updateNode(it.polito.neo4j.jaxb.Node node, long graphId, long nodeId) throws MyNotFoundException, MyInvalidObjectException, MyInvalidIdException;
+ public Graph updateGraph(Graph graph, long graphId) throws MyNotFoundException, MyInvalidObjectException, DuplicateNodeException, MyInvalidIdException;
+ public it.polito.neo4j.jaxb.Node updateNeighbour(Neighbour neighbour, long graphId, long nodeId, long neighbourId) throws MyNotFoundException, MyInvalidObjectException;
+
+ public Paths findAllPathsBetweenTwoNodes(long graphId, String srcName, String dstName, String direction) throws MyNotFoundException;
+}