|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.client.DatasetService
public class DatasetService
The DatasetService is the central management point for a single connection to a Anzo Server. The Serivce contains methods for querying,replication, and notification. The Service provides the methods to get remote and local graphs/models. The graph/model is bound to the DatasetService that creates it, and all graphs/models created with a single DatasetService share a common TransactionQueue, NotificationService and persistence provider.
| Constructor Summary | |
|---|---|
DatasetService(java.util.Properties properties)
Constructor for a DatasetService. |
|
DatasetService(java.util.Properties properties,
IModelService modelService,
INotificationService notificationService,
IReplicationService replicationService)
Constructor for a DatasetService. |
|
| Method Summary | |
|---|---|
void |
abort()
Abort the current transaction |
void |
begin()
Begin a transaction |
void |
beginNonBlocking()
Begin a NonBlocking transaction |
void |
clearNotificationTransaction()
Clear the current notificationTransaction |
void |
close()
Close DatasetService by closing all Local and Remote graphs and disconnecting notification service if needed. |
void |
closeLocalGraph(LocalGraph baseGraph)
Decrements usage count for Local NamedGraph. |
void |
closeRemoteGraph(RemoteGraph baseGraph)
Decrements usage count for Remote NamedGraph. |
void |
commit()
Commit the current transaction |
boolean |
currentThreadOwnsTransaction()
Return true if current thread owns current transaction |
QueryResult |
execQuery(IDataset dataset,
java.lang.String query)
Execute a SPARQL query against graphs contained within the dataset passed in, using a local query engine. |
QueryResult |
execQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphs,
java.util.Set<org.openrdf.model.URI> namedGraphs,
java.lang.String query)
Execute a SPARQL query against graphs contained within this dataset service, using a local query engine. |
java.lang.Object |
executeInTransaction(Command command)
Execute a command within a transaction |
void |
executeInTransaction(CommandChain commands)
Execute a CommandChain within a transaction |
IContainer |
getBaseContainer()
Get the transactionNamedgraphContainer |
IDataset |
getCurrentDataset()
Return a Dataset that contains all the currently open NamedGraphs,either local or remote. |
IDataset |
getCurrentLocalDataset()
Get the currentLocalDataset containing the open local NamedGraphs |
IDataset |
getCurrentRemoteDataset()
Get the currentRemoteDataset containing the open remote NamedGraphs |
java.util.concurrent.Executor |
getCustomExecutor()
Get the customExecutor for DatasetService. |
DatasetServiceReplicator |
getDatasetReplicator()
Get the DatasetReplicator for the DatasetService |
DatasetServiceEventManager |
getEventManager()
Get the DatasetService's EventManager |
IDataset |
getLocalDataSet(org.openrdf.model.URI datasetUri,
boolean create,
boolean createImmediately,
boolean addNamedGraphTrackers,
java.util.Set<org.openrdf.model.URI> defaultNamedGraphUris,
java.util.Set<org.openrdf.model.URI> namedGraphUris)
Create a new ClosableDatasetServiceDataset that contains the defaultNamedGraphUris listed and the NamedGraphs listed. |
LocalGraph |
getLocalGraph(org.openrdf.model.URI namedGraphUri,
boolean create,
boolean addNamedGraphTracker)
Get a Local NamedGraph for the URI, creating one if it doesn't exist depending on the create flag |
LocalGraph |
getLocalGraph(org.openrdf.model.URI namedGraphUri,
org.openrdf.model.URI metadataGraphUri,
boolean create,
boolean addNamedGraphTracker)
Get a LocalGraph for the given URIs, creating one if it doesn't exist depending on the create flag |
LocalGraph |
getLocalSystemGraph(boolean addNamedGraphTracker)
Get a Local NamedGraph representation of the Server's system graph. |
IModelService |
getModelService()
Get the DatasetService's IModelService |
IContainer |
getNamedgraphContainer()
Get the container that stores all local data |
IContainer |
getNotificationNamedgraphContainer()
Get the notificationNamedgraphContainer |
INotificationService |
getNotificationService()
Get the DatasetService's INotificationService |
ITransaction |
getNotificationTransaction()
Get the notificationTransaction |
IDataset |
getRemoteDataSet(org.openrdf.model.URI datasetUri,
boolean create,
java.util.Set<org.openrdf.model.URI> defaultNamedGraphUris,
java.util.Set<org.openrdf.model.URI> namedGraphUris)
Create a new ClosableDatasetServiceDataset that contains the defaultNamedGraphUris listed and the NamedGraphs listed. |
RemoteGraph |
getRemoteGraph(org.openrdf.model.URI namedGraphUri,
boolean create)
Get a Remote NamedGraph for the given URI, creating one if it doesn't exist depending on the create flag. |
RemoteGraph |
getRemoteGraph(org.openrdf.model.URI namedGraphUri,
org.openrdf.model.URI metadataGraphUri,
boolean create)
Get a Remote NamedGraph for the given URIs, creating one if it doesn't exist depending on the create flag. |
RemoteGraph |
getRemoteSystemGraph()
Get a RemoteGraph representation of the Server's system graph. |
ITransactionQueueManager |
getTransactionManager()
Get the DatasetService's TransactionQueueManager |
ITransactionQueue |
getTransactionQueue()
Get the TransactionQueue for DatasetService. |
org.openrdf.model.ValueFactory |
getValueFactory()
Get the ValueFactory for this DatasetService |
boolean |
isClosed()
Determine if the datasetService is closed |
boolean |
isIndexSynchronousOnUpdate()
Determine if indexer should update Synchronously. |
boolean |
isInTransaction()
Determine if within currently within a transaction |
boolean |
isLocalGraphOpen(org.openrdf.model.URI namedGraphUri)
Returns if the a LocalNamedGraph is open |
boolean |
isNamedGraphStored(org.openrdf.model.URI namedGraphUri)
Returns if the NamedGraph is stored on the server |
boolean |
isPersisted()
Get whether the Local NamedGraphs for this DatasetService will be persisted. |
boolean |
isRemoteGraphOpen(org.openrdf.model.URI namedGraphUri)
Returns if the a RemoteNamedGraph is open |
void |
setCustomExecutor(java.util.concurrent.Executor customExecutor)
Set the customExecutor for DatasetService. |
void |
setIndexSynchronousOnUpdate(boolean indexSynchronousOnUpdate)
Set if the indexer should update Synchronous. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatasetService(java.util.Properties properties)
properties - Configuration properties.ModelServiceProperties,
NotificationProperties,
RDBProperties,
DatasetServiceProperties
public DatasetService(java.util.Properties properties,
IModelService modelService,
INotificationService notificationService,
IReplicationService replicationService)
properties - Configuration properties.modelService - to usenotificationService - to usereplicationService - to useModelServiceProperties,
NotificationProperties,
RDBProperties,
DatasetServiceProperties| Method Detail |
|---|
public boolean isNamedGraphStored(org.openrdf.model.URI namedGraphUri)
throws AnzoException
namedGraphUri - URI of NamedGraph to check for on server
AnzoExceptionpublic boolean isLocalGraphOpen(org.openrdf.model.URI namedGraphUri)
namedGraphUri - URI of the NamedGraph
public boolean isRemoteGraphOpen(org.openrdf.model.URI namedGraphUri)
namedGraphUri - URI of the NamedGraph
public boolean isPersisted()
public LocalGraph getLocalGraph(org.openrdf.model.URI namedGraphUri,
boolean create,
boolean addNamedGraphTracker)
throws AnzoException
namedGraphUri - URI for the desired NamedGraphcreate - Created new NamedGraph if it does not exist on the serveraddNamedGraphTracker - Add a notification tracker for the graph in order to get current contents for NamedGraph
AnzoException
public LocalGraph getLocalGraph(org.openrdf.model.URI namedGraphUri,
org.openrdf.model.URI metadataGraphUri,
boolean create,
boolean addNamedGraphTracker)
throws AnzoException
namedGraphUri - URI for the desired NamedGraphmetadataGraphUri - metadata graph's URI for the desired NamedGraphcreate - Created new NamedGraph if it does not exist on the serveraddNamedGraphTracker - Add a notification tracker for the graph in order to get current contents for NamedGraph
AnzoException
public LocalGraph getLocalSystemGraph(boolean addNamedGraphTracker)
throws AnzoException
addNamedGraphTracker - Add a NamedGraphTracker for graph in order to get current contents for NamedGraph
AnzoException
public RemoteGraph getRemoteGraph(org.openrdf.model.URI namedGraphUri,
boolean create)
throws AnzoException
namedGraphUri - URI for the desired NamedGraphcreate - Created new NamedGraph if it does not exist on the server
AnzoException
public RemoteGraph getRemoteGraph(org.openrdf.model.URI namedGraphUri,
org.openrdf.model.URI metadataGraphUri,
boolean create)
throws AnzoException
namedGraphUri - URI for the desired NamedGraphmetadataGraphUri - metadata graph's URI for the desired NamedGraphcreate - Created new NamedGraph if it does not exist on the server
AnzoException
public RemoteGraph getRemoteSystemGraph()
throws AnzoException
AnzoException - if the User doesn't have the rights to see the system graphpublic IModelService getModelService()
public INotificationService getNotificationService()
public void closeLocalGraph(LocalGraph baseGraph)
throws AnzoException
baseGraph - to close
AnzoException
public void closeRemoteGraph(RemoteGraph baseGraph)
throws AnzoException
baseGraph - to close
AnzoExceptionpublic void close()
public java.util.concurrent.Executor getCustomExecutor()
public void setCustomExecutor(java.util.concurrent.Executor customExecutor)
customExecutor - for this DatasetServicepublic boolean isIndexSynchronousOnUpdate()
public void setIndexSynchronousOnUpdate(boolean indexSynchronousOnUpdate)
indexSynchronousOnUpdate - if the indexer should update Synchronous.public ITransactionQueue getTransactionQueue()
public DatasetServiceEventManager getEventManager()
public ITransactionQueueManager getTransactionManager()
public IDataset getLocalDataSet(org.openrdf.model.URI datasetUri,
boolean create,
boolean createImmediately,
boolean addNamedGraphTrackers,
java.util.Set<org.openrdf.model.URI> defaultNamedGraphUris,
java.util.Set<org.openrdf.model.URI> namedGraphUris)
datasetUri - URI for datasetcreate - Create the NamedGraphs if they don't already existcreateImmediately - NamedGraphs should be created immediately when the dataset is createdaddNamedGraphTrackers - Add a NamedGraphTracker for each LocalNamedGraph created threw the DatasetdefaultNamedGraphUris - Set of NamedGraphs to union as DefaultModel of DatasetnamedGraphUris - Set of NamedGraphs for Dataset
public IDataset getRemoteDataSet(org.openrdf.model.URI datasetUri,
boolean create,
java.util.Set<org.openrdf.model.URI> defaultNamedGraphUris,
java.util.Set<org.openrdf.model.URI> namedGraphUris)
datasetUri - URI for datasetcreate - Create the NamedGraphs if they don't already existdefaultNamedGraphUris - Set of NamedGraphs to union as DefaultModel of DatasetnamedGraphUris - Set of NamedGraphs for Dataset
public DatasetServiceReplicator getDatasetReplicator()
public IDataset getCurrentDataset()
public QueryResult execQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphs,
java.util.Set<org.openrdf.model.URI> namedGraphs,
java.lang.String query)
defaultNamedGraphs - Set of NamedGraphs using to make up default model in querynamedGraphs - Set of NamedGraphs using to make up named graphs in queryquery - Query to run
public QueryResult execQuery(IDataset dataset,
java.lang.String query)
dataset - Dataset to run query againstquery - Query to run
public IDataset getCurrentLocalDataset()
public IDataset getCurrentRemoteDataset()
public ITransaction getNotificationTransaction()
public void clearNotificationTransaction()
public IContainer getNamedgraphContainer()
public org.openrdf.model.ValueFactory getValueFactory()
public void abort()
throws AnzoException
AnzoException
public void begin()
throws AnzoException
AnzoException
public void beginNonBlocking()
throws AnzoException
AnzoException
public void commit()
throws AnzoException
AnzoExceptionpublic boolean currentThreadOwnsTransaction()
public java.lang.Object executeInTransaction(Command command)
throws AnzoException
command - Command to execute in transaction
AnzoException
public void executeInTransaction(CommandChain commands)
throws AnzoException
commands - CommandChain to execute in transaction
AnzoExceptionpublic boolean isInTransaction()
public boolean isClosed()
public IContainer getNotificationNamedgraphContainer()
public IContainer getBaseContainer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||