From a42de79292d9541db7865b54e93be2d0b6e6a094 Mon Sep 17 00:00:00 2001 From: "serena.spinoso" Date: Thu, 7 Sep 2017 10:22:39 +0200 Subject: update verigraph JIRA: PARSER-154 code optimizations about graph manipulation and formula generation. Change-Id: Idebef19b128281aa2bc40d1aeab6e208c7ddd93d Signed-off-by: serena.spinoso --- .../polito/neo4j/manager/Neo4jDBInteraction.java | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java (limited to 'verigraph/src/it/polito/neo4j/manager/Neo4jDBInteraction.java') 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 getNodes(long graphId) throws MyNotFoundException; + public it.polito.neo4j.jaxb.Node getNode(long graphId, long nodeId) throws MyNotFoundException; + public Set 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; +} -- cgit 1.2.3-korg