org.trippi
Interface TriplestoreWriter

All Superinterfaces:
TriplestoreReader
All Known Implementing Classes:
ConcurrentTriplestoreWriter, SynchronizedTriplestoreWriter

public interface TriplestoreWriter
extends TriplestoreReader

A TriplestoreReader that also provides buffered write access.

Author:
cwilper@cs.cornell.edu

Method Summary
 void add(java.util.List triples, boolean flush)
          Add a series of triples to the store.
 void add(org.jrdf.graph.Triple triple, boolean flush)
          Add a single triple to the store.
 void add(TripleIterator iter, boolean flush)
          Add a series of triples to the store.
 void delete(java.util.List triples, boolean flush)
          Remove a series of triples from the store.
 void delete(org.jrdf.graph.Triple triple, boolean flush)
          Remove a single triple from the store (convenience method).
 void delete(TripleIterator iter, boolean flush)
          Remove a series of triples from the store.
 java.util.List findBufferedUpdates(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object, int updateType)
          Returns an unmodifiable List of TripleUpdates currently in queue.
 void flushBuffer()
          Flush the buffer (write the changes to the triplestore).
 int getBufferSize()
          Get the current size of the buffer.
 void setFlushErrorHandler(FlushErrorHandler h)
          Set the (optional) handler that will recieve failed flush notification.
 
Methods inherited from interface org.trippi.TriplestoreReader
close, countTriples, countTriples, countTriples, countTuples, findTriples, findTriples, findTriples, findTuples, getAliasMap, listTripleLanguages, listTupleLanguages, setAliasMap
 

Method Detail

add

void add(java.util.List triples,
         boolean flush)
         throws java.io.IOException,
                TrippiException
Add a series of triples to the store.

Parameters:
triples - a list of Triple objects
flush - whether to flush the buffer before returning
Throws:
java.io.IOException
TrippiException

add

void add(TripleIterator iter,
         boolean flush)
         throws java.io.IOException,
                TrippiException
Add a series of triples to the store.

Parameters:
iter - an iterator over the triples
flush - whether to flush the buffer before returning
Throws:
java.io.IOException
TrippiException

add

void add(org.jrdf.graph.Triple triple,
         boolean flush)
         throws java.io.IOException,
                TrippiException
Add a single triple to the store.

Parameters:
triple - the Triple to add
flush - whether to flush the buffer before returning
Throws:
java.io.IOException
TrippiException

delete

void delete(java.util.List triples,
            boolean flush)
            throws java.io.IOException,
                   TrippiException
Remove a series of triples from the store.

Parameters:
triples - a list of Triple objects
flush - whether to flush the buffer before returning
Throws:
java.io.IOException
TrippiException

delete

void delete(TripleIterator iter,
            boolean flush)
            throws java.io.IOException,
                   TrippiException
Remove a series of triples from the store.

Parameters:
iter - an iterator over the triples
flush - whether to flush the buffer before returning
Throws:
java.io.IOException
TrippiException

delete

void delete(org.jrdf.graph.Triple triple,
            boolean flush)
            throws java.io.IOException,
                   TrippiException
Remove a single triple from the store (convenience method).

Parameters:
triple - the Triple to delete
flush - whether to flush the buffer before returning
Throws:
java.io.IOException
TrippiException

flushBuffer

void flushBuffer()
                 throws java.io.IOException,
                        TrippiException
Flush the buffer (write the changes to the triplestore).

Throws:
java.io.IOException
TrippiException

setFlushErrorHandler

void setFlushErrorHandler(FlushErrorHandler h)
Set the (optional) handler that will recieve failed flush notification. Applications can use this to ensure that the contents of the buffer are not lost when a flushing error occurs.


getBufferSize

int getBufferSize()
Get the current size of the buffer.


findBufferedUpdates

java.util.List findBufferedUpdates(org.jrdf.graph.SubjectNode subject,
                                   org.jrdf.graph.PredicateNode predicate,
                                   org.jrdf.graph.ObjectNode object,
                                   int updateType)
Returns an unmodifiable List of TripleUpdates currently in queue.

Returns:
unmodifiable List of TripleUpdates currently in queue