|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.common.rdb.container.RDBConnection
public class RDBConnection
Connection to database
| Field Summary | |
|---|---|
static int |
QUERY
Constant for the Query type of connection |
static int |
RW
Constant for the Write type of connection |
| Constructor Summary | |
|---|---|
RDBConnection(org.apache.commons.pool.impl.GenericObjectPool connectionPool,
CacheProvider cacheProvider,
LiteralIndexer literalIndexer,
int type,
RDBConfiguration configuration,
java.sql.Connection connection)
Create a new RDBConnection |
|
| Method Summary | |
|---|---|
void |
abort()
Abort database transaction |
void |
add(java.util.Iterator<org.openrdf.model.Statement> statements)
Add a set of statements from container |
void |
add(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource context)
Add a new statement with given subj,pred,obj,context |
void |
add(org.openrdf.model.Statement... statements)
Add one or more statements to container |
void |
begin()
Begin database transaction Note:Database already in transaction |
void |
clear()
Delete all statements in container |
void |
clear(org.openrdf.model.Resource... context)
Delete all statements in container for given contexts |
void |
clear(org.openrdf.model.URI namedGraphUri)
Clear all statements from container for the given graph |
void |
clearDatabase()
Delete all the tables for this container |
void |
close()
Disconnect container from its source and close the container Note: Once a container is closed, it is based on the source of the container's data whether or not subsequent calls to connect will return the same data |
void |
commit()
Commit database transaction |
void |
connect()
Connect container to its source |
boolean |
contains(org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... contexts)
Tests if a statement is contained in the container. |
boolean |
contains(org.openrdf.model.Statement match)
Tests if a statement is contained in the container. |
void |
delete(java.util.Iterator<org.openrdf.model.Statement> statements)
Delete a set of statements from container |
void |
delete(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource context)
Delete a statement from container |
void |
delete(org.openrdf.model.Statement... statements)
Delete a set of statements from container |
void |
deleteInferedObject(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI object,
org.openrdf.model.URI inferedObject)
Delete an inferred object definition into the DB |
void |
deleteInferedProperty(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI inferedProperty)
Delete an inferred property definition into the DB |
QueryResult |
executeQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphsIn,
java.util.Set<org.openrdf.model.URI> namedGraphsIn,
java.lang.String query)
Execute a SPARQL query against the data within this container |
QueryResults |
executeQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphsIn,
java.util.Set<org.openrdf.model.URI> namedGraphsIn,
java.lang.String query,
boolean includeInferredStatements,
org.openrdf.model.URI ontology)
Execute a SPARQL query against the data within this container |
info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> |
find(org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... namedGraphUri)
Return an iterator over all statements that match the pattern of subj,prop,obj |
RDBConfiguration |
getConfiguration()
Get the configuration |
java.sql.Connection |
getConnection()
Get the underlying jdbc connection |
int |
getConnectionType()
Is the JDBC connection set to readOnly |
java.lang.String |
getContainerName()
Get the container's name |
java.util.Collection<org.openrdf.model.URI> |
getContexts()
Get the set of Context URIs that are container within this Container |
INamedGraphEventManager |
getEventManager()
Get the eventManager for this connection |
Engine |
getGlitter()
Get the Glitter engine for this connection |
LiteralIndexer |
getLiteralIndexer()
Get the literal indexer for this connection |
CompositeNodeLayout |
getNodeLayout()
Get the nodeLayout |
SQLCache |
getSQLCache()
Get the SQLCache for this connections |
info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> |
getStatements()
Get an iterator over all statements within this container |
ITransactionManager |
getTransactionManager()
Return ITransactionManager for this container |
org.openrdf.model.URI |
getURI()
Get URI of IContainer |
void |
insertInferedObject(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI object,
org.openrdf.model.URI inferedObject)
Insert an inferred object definition into the DB |
void |
insertInferedProperty(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI inferedProperty)
Insert an inferred property definition into the DB |
boolean |
isClosed()
Return if container is closed |
boolean |
isConnected()
Return if the container is connected to its source |
boolean |
isEmpty()
Return if container is empty |
boolean |
isEmpty(org.openrdf.model.Resource... context)
Return if container is empty for given contexts |
boolean |
isLocked()
Determine if currently in a transaction |
boolean |
isReturned()
Has this connection been returned to the ContainerConnectionPool |
void |
passivate()
Passivate this object to its pool |
void |
populateValidGraphs(java.util.Map<org.openrdf.model.Value,java.lang.Long> graphIds,
int includeAllNamedGraphsIn,
java.lang.String destinationTable)
Populate a temporary table with the ids of graphs that match the parameters |
void |
purgeOntology(org.openrdf.model.URI ontology)
Purge inferred object definitions from db for a given ontology |
void |
reset()
Reset the connections |
void |
reset(java.lang.Long id)
Server was reset |
void |
setConnection(java.sql.Connection connection)
Set the underlying jdbc connection |
void |
setContainerName(java.lang.String containerName)
Set the container's name |
void |
setEventManager(INamedGraphEventManager eventManager)
Set the event manager for this connection |
void |
setReturned(boolean returned)
Set if connection has been returned to the ContainerConnectionPool |
void |
setTransactionManager(ITransactionManager transactionManager)
Set ITransactionManager for this container |
void |
setURI(org.openrdf.model.URI uri)
Set the URI for this container |
int |
size()
Return number of statements in container |
int |
size(org.openrdf.model.Resource... namedGraphUri)
Return number of statements in container |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int QUERY
public static final int RW
| Constructor Detail |
|---|
public RDBConnection(org.apache.commons.pool.impl.GenericObjectPool connectionPool,
CacheProvider cacheProvider,
LiteralIndexer literalIndexer,
int type,
RDBConfiguration configuration,
java.sql.Connection connection)
connectionPool - the connection pool creating this connectioncacheProvider - the cache provider for of caches of node values to their idsliteralIndexer - the literal indexer for like text queriestype - the type of connectionconfiguration - the configuration data for the connectionconnection - the underlying jdbc connection| Method Detail |
|---|
public void connect()
IContainer
connect in interface IContainerpublic boolean isConnected()
IContainer
isConnected in interface IContainerpublic void setConnection(java.sql.Connection connection)
connection - the underlying jdbc connectionpublic java.sql.Connection getConnection()
public SQLCache getSQLCache()
public void setURI(org.openrdf.model.URI uri)
uri - for this containerpublic java.lang.String getContainerName()
public void setContainerName(java.lang.String containerName)
containerName - public org.openrdf.model.URI getURI()
IContainer
getURI in interface IContainerpublic void close()
IContainer
close in interface IContainerpublic boolean isClosed()
IContainer
isClosed in interface IContainerpublic void clear(org.openrdf.model.URI namedGraphUri)
namedGraphUri - of graph to clearpublic void reset()
public void clearDatabase()
public void add(java.util.Iterator<org.openrdf.model.Statement> statements)
IContainer
add in interface IContainerstatements - statements to add to container
public void add(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource context)
IContainer
add in interface IContainersubj - Subject of statementpred - Predicate of statementobj - Object of statementcontext - Context of statementpublic void clear()
IContainer
clear in interface IContainerpublic void clear(org.openrdf.model.Resource... context)
IContainer
clear in interface IContainercontext - Contexts to clear from container
public void delete(org.openrdf.model.Resource subj,
org.openrdf.model.URI pred,
org.openrdf.model.Value obj,
org.openrdf.model.Resource context)
IContainer
delete in interface IContainersubj - Subject resource to match, or wildcard if nullpred - Predicate uri to match, or wildcard if nullobj - Object value to match, or wildcard if nullcontext - Context values to match, or wildcard if nullpublic void add(org.openrdf.model.Statement... statements)
IContainer
add in interface IContainerstatements - statements to add to containerpublic void delete(org.openrdf.model.Statement... statements)
IContainer
delete in interface IContainerstatements - statements to delete from containerpublic void delete(java.util.Iterator<org.openrdf.model.Statement> statements)
IContainer
delete in interface IContainerstatements - statements to delete from containerpublic info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> getStatements()
IContainer
getStatements in interface IContainer
public info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> find(org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... namedGraphUri)
IContainer
find in interface IContainersubj - Subject resource to match, or wildcard if nullprop - Predicate uri to match, or wildcard if nullobj - Object value to match, or wildcard if nullnamedGraphUri - Context values to match, or wildcard if null
public int size()
IContainer
size in interface IContainerpublic int size(org.openrdf.model.Resource... namedGraphUri)
IContainer
size in interface IContainernamedGraphUri - Contexts of statements to count
public boolean isEmpty()
IContainer
isEmpty in interface IContainerpublic boolean isEmpty(org.openrdf.model.Resource... context)
IContainer
isEmpty in interface IContainercontext - Contexts of statements to count
public boolean contains(org.openrdf.model.Statement match)
contains in interface IContainermatch - is the statement to be tested
public boolean contains(org.openrdf.model.Resource subj,
org.openrdf.model.URI prop,
org.openrdf.model.Value obj,
org.openrdf.model.Resource... contexts)
contains in interface IContainersubj - Subject resource to match, or wildcard if nullprop - Predicate uri to match, or wildcard if nullobj - Object value to match, or wildcard if nullcontexts - Context values to match, or wildcard if null
public RDBConfiguration getConfiguration()
public CompositeNodeLayout getNodeLayout()
public boolean isLocked()
public void begin()
throws AnzoException
AnzoException - if there was an error starting transaction
public void abort()
throws AnzoException
AnzoException - if there was an error aborting transaction
public void commit()
throws AnzoException
AnzoException - if there was an error committing transaction
public QueryResult executeQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphsIn,
java.util.Set<org.openrdf.model.URI> namedGraphsIn,
java.lang.String query)
throws AnzoException
IContainer
executeQuery in interface IContainerdefaultNamedGraphsIn - Set<URI> of URIs for NamedGraphs that will make up the default graph for this querynamedGraphsIn - Set<URI> of URIs for NamedGraphs that will make up the NamedGraphs for this queryquery - SPARQL query string
AnzoException
public QueryResults executeQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphsIn,
java.util.Set<org.openrdf.model.URI> namedGraphsIn,
java.lang.String query,
boolean includeInferredStatements,
org.openrdf.model.URI ontology)
throws AnzoException
defaultNamedGraphsIn - Set<URI> of URIs for NamedGraphs that will make up the default graph for this querynamedGraphsIn - Set<URI> of URIs for NamedGraphs that will make up the NamedGraphs for this queryquery - SPARQL query stringincludeInferredStatements - should query include inferred statements in resultsontology - URI of ontology to use to determine inferred statements
AnzoExceptionpublic ITransactionManager getTransactionManager()
IContainer
getTransactionManager in interface IContainerpublic void setTransactionManager(ITransactionManager transactionManager)
IContainer
setTransactionManager in interface IContainertransactionManager - set ITransactionManager for this containerpublic Engine getGlitter()
public void purgeOntology(org.openrdf.model.URI ontology)
throws AnzoException
ontology - whose object definitions should be removed
AnzoException - if there was an error purging objects from db
public void insertInferedProperty(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI inferedProperty)
throws AnzoException
ontology - ontology to which the definition belongsproperty - property nameinferedProperty - inferred property
AnzoException - if there was an error inserting definition into the db
public void deleteInferedProperty(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI inferedProperty)
throws AnzoException
ontology - ontology to which the definition belongsproperty - property nameinferedProperty - inferred property
AnzoException - if there was an error deleting definition into the db
public void insertInferedObject(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI object,
org.openrdf.model.URI inferedObject)
throws AnzoException
ontology - ontology to which the definition belongsproperty - property nameobject - object valueinferedObject - inferred object value
AnzoException - if there was an error inserting definition into the db
public void deleteInferedObject(org.openrdf.model.URI ontology,
org.openrdf.model.URI property,
org.openrdf.model.URI object,
org.openrdf.model.URI inferedObject)
throws AnzoException
ontology - ontology to which the definition belongsproperty - property nameobject - object valueinferedObject - inferred object value
AnzoException - if there was an error deleting definition into the dbpublic INamedGraphEventManager getEventManager()
getEventManager in interface IContainerpublic void setEventManager(INamedGraphEventManager eventManager)
setEventManager in interface IContainereventManager - the eventManager
public void populateValidGraphs(java.util.Map<org.openrdf.model.Value,java.lang.Long> graphIds,
int includeAllNamedGraphsIn,
java.lang.String destinationTable)
throws java.sql.SQLException,
UnexpectedException
graphIds - ids to addincludeAllNamedGraphsIn - should all namedgraph ids be addeddestinationTable - name of temporary table to add into
java.sql.SQLException - if there was an sql exception thrown inserting the graph ids
UnexpectedException - if there was an unexpected exception populating tablepublic java.util.Collection<org.openrdf.model.URI> getContexts()
IContainer
getContexts in interface IContainerpublic boolean isReturned()
public void setReturned(boolean returned)
returned - public int getConnectionType()
public void passivate()
throws java.lang.Exception
java.lang.Exceptionpublic void reset(java.lang.Long id)
IResetListener
reset in interface IResetListenerid - of server that was resetpublic LiteralIndexer getLiteralIndexer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||