org.openrdf.repository.flushable
Class FlushableConnection

java.lang.Object
  extended by org.openrdf.repository.base.RepositoryConnectionBase
      extended by org.openrdf.repository.base.RepositoryConnectionWrapper
          extended by org.openrdf.repository.flushable.FlushableConnection
All Implemented Interfaces:
DelegatingRepositoryConnection, RepositoryConnection

public class FlushableConnection
extends RepositoryConnectionWrapper

When not in autoFlush mode, each statement added and removed is tracked. When calling one of the read methods listed below the statement results will be corrected to include or exclude the modified statements on this connection. This behaviour mimics transaction isolation, but does not include unflushed statements in query processing.

Author:
James Leigh
See Also:
getStatements(Resource, URI, Value, boolean, Resource[]), RepositoryConnectionWrapper.hasStatement(Statement, boolean, Resource[]), RepositoryConnectionWrapper.hasStatement(Resource, URI, Value, boolean, Resource[]), isEmpty(), RepositoryConnectionBase.export(RDFHandler, Resource[]), RepositoryConnectionWrapper.exportStatements(Resource, URI, Value, boolean, RDFHandler, Resource[])

Field Summary
 
Fields inherited from class org.openrdf.repository.base.RepositoryConnectionBase
logger
 
Constructor Summary
FlushableConnection(Repository repository)
           
FlushableConnection(Repository repository, RepositoryConnection conn)
           
 
Method Summary
protected  void addWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts)
           
 void clear()
           
 void close()
           
 void commit()
           
 void flush()
           
 RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts)
           
 boolean isAutoFlush()
           
protected  boolean isDelegatingAdd()
           
protected  boolean isDelegatingRead()
           
protected  boolean isDelegatingRemove()
           
 boolean isEmpty()
           
protected  void removeWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts)
           
 void rollback()
           
 void setAutoCommit(boolean autoCommit)
           
 void setAutoFlush(boolean autoFlush)
           
 long size(Resource... contexts)
           
 
Methods inherited from class org.openrdf.repository.base.RepositoryConnectionWrapper
add, add, add, add, add, add, add, add, clear, clearNamespaces, exportStatements, exportStatements, getContextIDs, getDelegate, getNamespace, getNamespaces, hasStatement, hasStatement, isAutoCommit, isOpen, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, remove, remove, remove, remove, removeNamespace, setDelegate, setNamespace
 
Methods inherited from class org.openrdf.repository.base.RepositoryConnectionBase
addInputStreamOrReader, addWithoutCommit, autoCommit, export, finalize, getRepository, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, removeWithoutCommit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openrdf.repository.RepositoryConnection
export, getRepository, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery
 

Constructor Detail

FlushableConnection

public FlushableConnection(Repository repository)
                    throws RepositoryException
Throws:
RepositoryException

FlushableConnection

public FlushableConnection(Repository repository,
                           RepositoryConnection conn)
                    throws RepositoryException
Throws:
RepositoryException
Method Detail

isAutoFlush

public boolean isAutoFlush()
                    throws RepositoryException
Throws:
RepositoryException

setAutoFlush

public void setAutoFlush(boolean autoFlush)
                  throws RepositoryException
Throws:
RepositoryException

flush

public void flush()
           throws RepositoryException
Throws:
RepositoryException

clear

public void clear()
           throws RepositoryException
Throws:
RepositoryException

isDelegatingAdd

protected boolean isDelegatingAdd()
                           throws RepositoryException
Overrides:
isDelegatingAdd in class RepositoryConnectionWrapper
Throws:
RepositoryException

isDelegatingRead

protected boolean isDelegatingRead()
                            throws RepositoryException
Overrides:
isDelegatingRead in class RepositoryConnectionWrapper
Throws:
RepositoryException

isDelegatingRemove

protected boolean isDelegatingRemove()
                              throws RepositoryException
Overrides:
isDelegatingRemove in class RepositoryConnectionWrapper
Throws:
RepositoryException

close

public void close()
           throws RepositoryException
Specified by:
close in interface RepositoryConnection
Overrides:
close in class RepositoryConnectionWrapper
Throws:
RepositoryException

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws RepositoryException
Specified by:
setAutoCommit in interface RepositoryConnection
Overrides:
setAutoCommit in class RepositoryConnectionWrapper
Throws:
RepositoryException

commit

public void commit()
            throws RepositoryException
Specified by:
commit in interface RepositoryConnection
Overrides:
commit in class RepositoryConnectionWrapper
Throws:
RepositoryException

rollback

public void rollback()
              throws RepositoryException
Specified by:
rollback in interface RepositoryConnection
Overrides:
rollback in class RepositoryConnectionWrapper
Throws:
RepositoryException

getStatements

public RepositoryResult<Statement> getStatements(Resource subj,
                                                 URI pred,
                                                 Value obj,
                                                 boolean includeInferred,
                                                 Resource... contexts)
                                          throws RepositoryException
Specified by:
getStatements in interface RepositoryConnection
Overrides:
getStatements in class RepositoryConnectionWrapper
Throws:
RepositoryException

isEmpty

public boolean isEmpty()
                throws RepositoryException
Specified by:
isEmpty in interface RepositoryConnection
Overrides:
isEmpty in class RepositoryConnectionWrapper
Throws:
RepositoryException

size

public long size(Resource... contexts)
          throws RepositoryException
Specified by:
size in interface RepositoryConnection
Overrides:
size in class RepositoryConnectionWrapper
Throws:
RepositoryException

addWithoutCommit

protected void addWithoutCommit(Resource subject,
                                URI predicate,
                                Value object,
                                Resource... contexts)
                         throws RepositoryException
Overrides:
addWithoutCommit in class RepositoryConnectionWrapper
Throws:
RepositoryException

removeWithoutCommit

protected void removeWithoutCommit(Resource subject,
                                   URI predicate,
                                   Value object,
                                   Resource... contexts)
                            throws RepositoryException
Overrides:
removeWithoutCommit in class RepositoryConnectionWrapper
Throws:
RepositoryException


Copyright © 2004-2008 Aduna. All Rights Reserved.