com.hp.hpl.jena.util
Class MonitorModel

java.lang.Object
  extended by com.hp.hpl.jena.enhanced.EnhGraph
      extended by com.hp.hpl.jena.rdf.model.impl.ModelCom
          extended by com.hp.hpl.jena.util.MonitorModel
All Implemented Interfaces:
Model, ModelCon, ModelGraphInterface, RDFReaderF, RDFWriterF, Lock, PrefixMapping

public class MonitorModel
extends com.hp.hpl.jena.rdf.model.impl.ModelCom

Model wrapper which provides normal access to an underlying model but also maintains a snapshot of the triples it was last known to contain. A snapshot action causes the set of changes between this and the previous snapshot to be calculated and the cache updated. The snapshot process will also fire change notification.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.hp.hpl.jena.shared.PrefixMapping
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException
 
Field Summary
 
Fields inherited from interface com.hp.hpl.jena.shared.PrefixMapping
Extended, Standard
 
Fields inherited from interface com.hp.hpl.jena.shared.Lock
READ, WRITE
 
Constructor Summary
MonitorModel(Model base)
          Create a monitor over the given underlying base model.
 
Method Summary
 void snapshot()
          Compute the differences between the current monitored graph and the last snapshot, forward any changes to registered listeners, then take a new snapshot.
 void snapshot(List<Statement> additions, List<Statement> deletions)
          Compute the differences between the current monitored graph and the last snapshot.
 
Methods inherited from class com.hp.hpl.jena.rdf.model.impl.ModelCom
abort, adapt, add, add, add, add, add, add, add, add, add, add, add, add, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addNamespaces, asFilter, asModel, asNode, asRDFNode, asStatement, asStatements, asStatements, asStatements, begin, close, commit, contains, contains, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsResource, createAlt, createAlt, createBag, createBag, createList, createList, createList, createLiteral, createLiteral, createLiteral, createLiteral, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createProperty, createProperty, createReifiedStatement, createReifiedStatement, createResource, createResource, createResource, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, enterCriticalSection, executeInTransaction, expandPrefix, findTriplesFrom, getAlt, getAlt, getAnyReifiedStatement, getBag, getBag, getDefaultModelPrefixes, getGraph, getHiddenStatements, getLock, getModelLock, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, getProperty, getProperty, getProperty, getRDFNode, getReader, getReader, getReificationStyle, getRequiredProperty, getResource, getResource, getSeq, getSeq, getWriter, getWriter, independent, intersect, intersection, isClosed, isEmpty, isIsomorphicWith, isReified, leaveCriticalSection, listBySubject, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listReifiedStatements, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, lock, notifyEvent, qnameFor, query, read, read, read, read, read, read, read, register, reifiedToString, remove, remove, remove, remove, remove, remove, remove, removeAll, removeAll, removeAllReifications, removeNsPrefix, removeReader, removeReification, removeWriter, resetRDFReaderF, resetRDFWriterF, samePrefixMappingAs, setDefaultModelPrefixes, setNsPrefix, setNsPrefixes, setNsPrefixes, setReaderClassName, setWriterClassName, shortForm, size, supportsSetOperations, supportsTransactions, toString, union, unregister, withDefaultMappings, wrapAsResource, write, write, write, write, write, write
 
Methods inherited from class com.hp.hpl.jena.enhanced.EnhGraph
asGraph, equals, getNodeAs, getNodeCacheControl, hashCode, isIsomorphicWith, setNodeCache
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.Model
equals
 

Constructor Detail

MonitorModel

public MonitorModel(Model base)
Create a monitor over the given underlying base model.

Method Detail

snapshot

public void snapshot(List<Statement> additions,
                     List<Statement> deletions)
Compute the differences between the current monitored graph and the last snapshot. The changes will also be forwarded to any listeners. Then take a new snapshot.

Parameters:
additions - a place in which the set of newly added statements should be noted, can be null
deletions - a place in which the set of newly deleted statements should be noted, can be null

snapshot

public void snapshot()
Compute the differences between the current monitored graph and the last snapshot, forward any changes to registered listeners, then take a new snapshot.



Licenced under the Apache License, Version 2.0