com.hp.hpl.guess.storage
Interface StorageListener

All Known Implementing Classes:
DBServer, DumbStorage

public interface StorageListener

basic interface to databases and other things that store nodes and edges for us


Method Summary
 void addEdge(Edge e)
           
 void addField(Field f)
          add a new field to the database
 void addNode(Node node)
           
 boolean containsEdge(Edge e)
           
 boolean containsEdge(Edge e, String st)
           
 boolean containsNode(Node n)
           
 boolean containsNode(Node n, String st)
           
 int createDirectedEdge(Node source, Node dest)
          adds a new edge to the database and return its ID.
 int createDirectedEdge(Node source, Node dest, int id)
          adds a new edge to the database and return its ID.
 void createEmpty()
           
 int createUndirectedEdge(Node source, Node dest)
          adds a new edge to the database and return its ID.
 int createUndirectedEdge(Node source, Node dest, int id)
          adds a new edge to the database and return its ID.
 void exportGDF(String filename)
           
 void fillSchema(EdgeSchema ns, Graph g)
          This usually gets called once to add the fields alrady present for nodes that the database knows about.
 void fillSchema(NodeSchema ns, Graph g)
          This usually gets called once to add the fields alrady present for nodes that the database knows about.
 void findMatchingEdges(Query q)
          find all matching edges for query q, q will be modified to hold the results
 void findMatchingNodes(Query q)
          find all matching nodes for query q, q will be modified to hold the results
 Object getColumn(Edge e, Field f)
          returns the value of Field f in for Edge n
 Object getColumn(Edge e, Field f, int state)
          returns the value of Field f in for Edge n
 Object getColumn(Edge e, Field f, String state)
          returns the value of Field f in for Edge n
 Object getColumn(Node n, Field f)
          returns the value of Field f in for Node n
 Object getColumn(Node n, Field f, int state)
          returns the value of Field f in for Node n
 Object getColumn(Node n, Field f, String state)
          returns the value of Field f in for Node n
 Object[] getColumns(Edge e, Field[] f)
          returns the value of Field[] f in for Edge n
 Object[] getColumns(Edge e, Field[] f, int state)
          returns the value of Field[] f in for Edge n
 Object[] getColumns(Edge e, Field[] f, String state)
          returns the value of Field[] f in for Edge n
 Object[] getColumns(Node n, Field[] f)
          returns the value of Field[] f in for Node n
 Object[] getColumns(Node n, Field[] f, int state)
          returns the value of Field[] f in for Node n
 Object[] getColumns(Node n, Field[] f, String state)
          returns the value of Field[] f in for Node n
 Vector getEdgesNotInCurrent(Graph g, int statenum)
           
 Vector getEdgesNotInCurrent(Graph g, String statenum)
           
 AbstractTableModel getEdgeTable()
           
 Vector getNodesNotInCurrent(Graph g, int statenum)
           
 Vector getNodesNotInCurrent(Graph g, String statenum)
           
 AbstractTableModel getNodeTable()
           
 Set getStates()
           
 Object getStatistic(Field f, String statType)
           
 void loadFromFile(String file)
           
 void loadFromText(String text)
           
 void loadState(Graph g, int state)
           
 void loadState(Graph g, String state)
           
 void loadState(int state)
           
 void loadState(String state)
           
 void refresh(Graph g)
          call this to load up all the nodes/edges from the database into the graph.
 void remove(Edge edge)
           
 void remove(Node node)
           
 void removeComplete(Edge edge)
           
 void removeComplete(Node node)
           
 void saveState(int state)
           
 void saveState(String state)
           
 void shutdown()
          shutdown operator, once you call this don't assume you can do anything with the StorageListener
 void undelete(Edge edge)
           
 void undelete(Node node)
           
 void updateColumn(Edge e, Field f, Object value)
          call this to update the value for field f for Edge n.
 void updateColumn(Node n, Field f, Object value)
          call this to update the value for field f for Node n.
 

Method Detail

findMatchingNodes

public void findMatchingNodes(Query q)
find all matching nodes for query q, q will be modified to hold the results

Parameters:
q - the query to evaluate

findMatchingEdges

public void findMatchingEdges(Query q)
find all matching edges for query q, q will be modified to hold the results

Parameters:
q - the query to evaluate

fillSchema

public void fillSchema(NodeSchema ns,
                       Graph g)
This usually gets called once to add the fields alrady present for nodes that the database knows about. Once this is done new Fields (e.g. columns) should not be added to the underlying datastore without informing the schema.

See Also:
com.hp.hpl.Schema#addFieldToSL(Field), #addFieldToSL(Field);

fillSchema

public void fillSchema(EdgeSchema ns,
                       Graph g)
This usually gets called once to add the fields alrady present for nodes that the database knows about. Once this is done new Fields (e.g. columns) should not be added to the underlying datastore without informing the schema.

See Also:
com.hp.hpl.Schema#addFieldToSL(Field), #addFieldToSL(Field);

updateColumn

public void updateColumn(Node n,
                         Field f,
                         Object value)
call this to update the value for field f for Node n.

Parameters:
n - the node that is being modified
f - the field that you want changed (e.g. column)
value - the new value

updateColumn

public void updateColumn(Edge e,
                         Field f,
                         Object value)
call this to update the value for field f for Edge n.

Parameters:
e - the edge that is being modified
f - the field that you want changed (e.g. column)
value - the new value

refresh

public void refresh(Graph g)
call this to load up all the nodes/edges from the database into the graph.

Parameters:
g - the graph to load the results into

addField

public void addField(Field f)
add a new field to the database

Parameters:
f - the field to add

shutdown

public void shutdown()
shutdown operator, once you call this don't assume you can do anything with the StorageListener


getColumn

public Object getColumn(Node n,
                        Field f)
returns the value of Field f in for Node n

Parameters:
n - the node you want the result for
f - the field

getColumn

public Object getColumn(Edge e,
                        Field f)
returns the value of Field f in for Edge n

Parameters:
f - the field

getColumn

public Object getColumn(Node n,
                        Field f,
                        String state)
returns the value of Field f in for Node n

Parameters:
n - the node you want the result for
f - the field
state - the state to retrieve from

getColumn

public Object getColumn(Edge e,
                        Field f,
                        String state)
returns the value of Field f in for Edge n

Parameters:
f - the field
state - the state to retrieve from

getColumn

public Object getColumn(Node n,
                        Field f,
                        int state)
returns the value of Field f in for Node n

Parameters:
n - the node you want the result for
f - the field
state - the state to retrieve from

getColumn

public Object getColumn(Edge e,
                        Field f,
                        int state)
returns the value of Field f in for Edge n

Parameters:
f - the field
state - the state to retrieve from

getColumns

public Object[] getColumns(Node n,
                           Field[] f)
returns the value of Field[] f in for Node n

Parameters:
n - the node you want the result for
f - the field

getColumns

public Object[] getColumns(Edge e,
                           Field[] f)
returns the value of Field[] f in for Edge n

Parameters:
f - the field

getColumns

public Object[] getColumns(Node n,
                           Field[] f,
                           String state)
returns the value of Field[] f in for Node n

Parameters:
n - the node you want the result for
f - the field
state - the state to retrieve from

getColumns

public Object[] getColumns(Edge e,
                           Field[] f,
                           String state)
returns the value of Field[] f in for Edge n

Parameters:
f - the field
state - the state to retrieve from

getColumns

public Object[] getColumns(Node n,
                           Field[] f,
                           int state)
returns the value of Field[] f in for Node n

Parameters:
n - the node you want the result for
f - the field
state - the state to retrieve from

getColumns

public Object[] getColumns(Edge e,
                           Field[] f,
                           int state)
returns the value of Field[] f in for Edge n

Parameters:
f - the field
state - the state to retrieve from

createDirectedEdge

public int createDirectedEdge(Node source,
                              Node dest)
adds a new edge to the database and return its ID.


createUndirectedEdge

public int createUndirectedEdge(Node source,
                                Node dest)
adds a new edge to the database and return its ID.


createDirectedEdge

public int createDirectedEdge(Node source,
                              Node dest,
                              int id)
adds a new edge to the database and return its ID. Forces specific __edgeid


createUndirectedEdge

public int createUndirectedEdge(Node source,
                                Node dest,
                                int id)
adds a new edge to the database and return its ID. Forces specific __edgeid


addNode

public void addNode(Node node)

undelete

public void undelete(Node node)

undelete

public void undelete(Edge edge)

remove

public void remove(Node node)

remove

public void remove(Edge edge)

removeComplete

public void removeComplete(Node node)

removeComplete

public void removeComplete(Edge edge)

loadState

public void loadState(Graph g,
                      int state)

loadState

public void loadState(Graph g,
                      String state)

loadState

public void loadState(String state)

loadState

public void loadState(int state)

saveState

public void saveState(int state)

saveState

public void saveState(String state)

getStatistic

public Object getStatistic(Field f,
                           String statType)

loadFromText

public void loadFromText(String text)

loadFromFile

public void loadFromFile(String file)

createEmpty

public void createEmpty()

getStates

public Set getStates()

getEdgesNotInCurrent

public Vector getEdgesNotInCurrent(Graph g,
                                   int statenum)

getEdgesNotInCurrent

public Vector getEdgesNotInCurrent(Graph g,
                                   String statenum)

getNodesNotInCurrent

public Vector getNodesNotInCurrent(Graph g,
                                   int statenum)

getNodesNotInCurrent

public Vector getNodesNotInCurrent(Graph g,
                                   String statenum)

getNodeTable

public AbstractTableModel getNodeTable()

getEdgeTable

public AbstractTableModel getEdgeTable()

containsEdge

public boolean containsEdge(Edge e,
                            String st)

containsEdge

public boolean containsEdge(Edge e)

containsNode

public boolean containsNode(Node n,
                            String st)

containsNode

public boolean containsNode(Node n)

addEdge

public void addEdge(Edge e)

exportGDF

public void exportGDF(String filename)