net.fortytwo.sesametools
Class SingleContextSail

java.lang.Object
  extended by org.openrdf.sail.helpers.SailBase
      extended by net.fortytwo.sesametools.SingleContextSail
All Implemented Interfaces:
org.openrdf.sail.Sail, org.openrdf.sail.StackableSail

public class SingleContextSail
extends org.openrdf.sail.helpers.SailBase
implements org.openrdf.sail.StackableSail

A Sail which treats the wildcard context as a single, specific context, and disallows read and write access to all other contexts, including the default context. Namespaces may be set and retrieved without restriction.

Author:
Joshua Shinavier (http://fortytwo.net)

Field Summary
 
Fields inherited from class org.openrdf.sail.helpers.SailBase
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, initializationLock, logger
 
Constructor Summary
SingleContextSail(org.openrdf.sail.Sail baseSail, org.openrdf.model.Resource context)
          Construct a Sail which is restricted to a single graph context.
 
Method Summary
 org.openrdf.sail.Sail getBaseSail()
           
protected  org.openrdf.sail.SailConnection getConnectionInternal()
           
 File getDataDir()
           
 org.openrdf.model.ValueFactory getValueFactory()
           
protected  void initializeInternal()
           
 boolean isWritable()
           
 void setBaseSail(org.openrdf.sail.Sail baseSail)
           
 void setDataDir(File dir)
           
protected  void shutDownInternal()
           
 
Methods inherited from class org.openrdf.sail.helpers.SailBase
connectionClosed, debugEnabled, getConnection, initialize, isInitialized, shutDown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openrdf.sail.Sail
getConnection, initialize, shutDown
 

Constructor Detail

SingleContextSail

public SingleContextSail(org.openrdf.sail.Sail baseSail,
                         org.openrdf.model.Resource context)
Construct a Sail which is restricted to a single graph context.

Parameters:
baseSail - a base Sail for storage
context - a single, non-null graph context
Method Detail

getBaseSail

public org.openrdf.sail.Sail getBaseSail()
Specified by:
getBaseSail in interface org.openrdf.sail.StackableSail

setBaseSail

public void setBaseSail(org.openrdf.sail.Sail baseSail)
Specified by:
setBaseSail in interface org.openrdf.sail.StackableSail

getConnectionInternal

protected org.openrdf.sail.SailConnection getConnectionInternal()
                                                         throws org.openrdf.sail.SailException
Specified by:
getConnectionInternal in class org.openrdf.sail.helpers.SailBase
Throws:
org.openrdf.sail.SailException

getDataDir

public File getDataDir()
Specified by:
getDataDir in interface org.openrdf.sail.Sail
Overrides:
getDataDir in class org.openrdf.sail.helpers.SailBase

getValueFactory

public org.openrdf.model.ValueFactory getValueFactory()
Specified by:
getValueFactory in interface org.openrdf.sail.Sail

initializeInternal

protected void initializeInternal()
                           throws org.openrdf.sail.SailException
Overrides:
initializeInternal in class org.openrdf.sail.helpers.SailBase
Throws:
org.openrdf.sail.SailException

isWritable

public boolean isWritable()
                   throws org.openrdf.sail.SailException
Specified by:
isWritable in interface org.openrdf.sail.Sail
Throws:
org.openrdf.sail.SailException

setDataDir

public void setDataDir(File dir)
Specified by:
setDataDir in interface org.openrdf.sail.Sail
Overrides:
setDataDir in class org.openrdf.sail.helpers.SailBase

shutDownInternal

protected void shutDownInternal()
                         throws org.openrdf.sail.SailException
Specified by:
shutDownInternal in class org.openrdf.sail.helpers.SailBase
Throws:
org.openrdf.sail.SailException


Copyright © 2014. All Rights Reserved.