com.hp.hpl.jena.sparql.core
Class DatasetGraphMonitor

java.lang.Object
  extended by com.hp.hpl.jena.sparql.core.DatasetGraphWrapper
      extended by com.hp.hpl.jena.sparql.core.DatasetGraphMonitor
All Implemented Interfaces:
DatasetGraph, Closeable, Sync

public class DatasetGraphMonitor
extends DatasetGraphWrapper

Connect a DatasetGraph to a DatasetChanges monitor. Any add or delete to the DatasetGraph is notified to the monitoring object with a QuadAction to indicate the change made.


Constructor Summary
DatasetGraphMonitor(DatasetGraph dsg, DatasetChanges monitor)
          Create a DatasetGraph wrapper that monitors the dataset for changes (add or delete quads).
DatasetGraphMonitor(DatasetGraph dsg, DatasetChanges monitor, boolean recordOnlyIfRealChange)
          Create a DatasetGraph wrapper that monitors the dataset for changes (add or delete quads).
 
Method Summary
 void add(Node g, Node s, Node p, Node o)
          Add a quad
 void add(Quad quad)
          Add a quad
 void addGraph(Node gn, Graph g)
          Add the given graph to the dataset.
 void delete(Node g, Node s, Node p, Node o)
          Delete a quad
 void delete(Quad quad)
          Delete a quad
 void deleteAny(Node g, Node s, Node p, Node o)
          Delete any quads matching the pattern
 DatasetChanges getMonitor()
          Return the monitor
 DatasetGraph monitored()
          Return the monitored DatasetGraph
 void removeGraph(Node gn)
          Remove all data associated with the named graph
 void sync()
           
 
Methods inherited from class com.hp.hpl.jena.sparql.core.DatasetGraphWrapper
close, contains, contains, containsGraph, find, find, find, findNG, getContext, getDefaultGraph, getGraph, getLock, getWrapped, isEmpty, listGraphNodes, setDefaultGraph, size, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatasetGraphMonitor

public DatasetGraphMonitor(DatasetGraph dsg,
                           DatasetChanges monitor)
Create a DatasetGraph wrapper that monitors the dataset for changes (add or delete quads). Use this DatasetGraph for all operations in order to record changes. Note whether additions of deletions cause an actual change to the dataset or not.

Parameters:
dsg - The DatasetGraph to monitor
monitor - The handler for a change
See Also:
DatasetChanges, QuadAction

DatasetGraphMonitor

public DatasetGraphMonitor(DatasetGraph dsg,
                           DatasetChanges monitor,
                           boolean recordOnlyIfRealChange)
Create a DatasetGraph wrapper that monitors the dataset for changes (add or delete quads). Use this DatasetGraph for all operations in order to record changes.

Parameters:
dsg - The DatasetGraph to monitor
monitor - The handler for a change
recordOnlyIfRealChange - If true, check to see if the chnage would have an effect (e.g. add is a new quad). If false, log changes as ADD/DELETE regardless of whether the dataset actually changes.
See Also:
DatasetChanges, QuadAction
Method Detail

getMonitor

public DatasetChanges getMonitor()
Return the monitor


monitored

public DatasetGraph monitored()
Return the monitored DatasetGraph


add

public void add(Quad quad)
Description copied from interface: DatasetGraph
Add a quad

Specified by:
add in interface DatasetGraph
Overrides:
add in class DatasetGraphWrapper

add

public void add(Node g,
                Node s,
                Node p,
                Node o)
Description copied from interface: DatasetGraph
Add a quad

Specified by:
add in interface DatasetGraph
Overrides:
add in class DatasetGraphWrapper

delete

public void delete(Quad quad)
Description copied from interface: DatasetGraph
Delete a quad

Specified by:
delete in interface DatasetGraph
Overrides:
delete in class DatasetGraphWrapper

delete

public void delete(Node g,
                   Node s,
                   Node p,
                   Node o)
Description copied from interface: DatasetGraph
Delete a quad

Specified by:
delete in interface DatasetGraph
Overrides:
delete in class DatasetGraphWrapper

deleteAny

public void deleteAny(Node g,
                      Node s,
                      Node p,
                      Node o)
Description copied from interface: DatasetGraph
Delete any quads matching the pattern

Specified by:
deleteAny in interface DatasetGraph
Overrides:
deleteAny in class DatasetGraphWrapper

addGraph

public void addGraph(Node gn,
                     Graph g)
Description copied from interface: DatasetGraph
Add the given graph to the dataset. Replaces any existing data for the named graph; to add data, get the graph and add triples to it, or add quads to the dataset. Do not assume that the same Java object is returned by DatasetGraph.getGraph(com.hp.hpl.jena.graph.Node)

Specified by:
addGraph in interface DatasetGraph
Overrides:
addGraph in class DatasetGraphWrapper

removeGraph

public void removeGraph(Node gn)
Description copied from interface: DatasetGraph
Remove all data associated with the named graph

Specified by:
removeGraph in interface DatasetGraph
Overrides:
removeGraph in class DatasetGraphWrapper

sync

public void sync()
Specified by:
sync in interface Sync
Overrides:
sync in class DatasetGraphWrapper


Licenced under the Apache License, Version 2.0