public class AGRepository extends RepositoryBase implements AGAbstractRepository
AGCatalog
contains multiple repositories.
With the Sesame API, most data operations on a repository are done through
the AGRepositoryConnection
returned by getConnection()
.Constructor and Description |
---|
AGRepository(AGCatalog catalog,
String repositoryID)
Creates an AGRepository instance for a repository having the given
repository id in the given catalog.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Calls Sesame method
AbstractRepository.shutDown() . |
void |
ensureDBIdle()
Waits until background db processes have gone idle.
|
void |
forceCheckpoint()
Forces a checkpoint for this repository.
|
AGCatalog |
getCatalog()
Gets the catalog to which this repository belongs.
|
String |
getCatalogPrefixedRepositoryID() |
AGRepositoryConnection |
getConnection()
Create a connection to the repository.
|
AGRepositoryConnection |
getConnection(ScheduledExecutorService executor)
Create a connection to the repository.
|
File |
getDataDir()
Deprecated.
not applicable to AllegroGraph
|
String |
getDuplicateSuppressionPolicy()
Returns the repository's duplicate suppression policy.
|
AGHTTPClient |
getHTTPClient() |
String |
getRepositoryID()
Gets the repository id for this repository.
|
String |
getRepositoryURL()
The AllegroGraph URL of this repository.
|
String |
getSpec() |
AGValueFactory |
getValueFactory() |
boolean |
isBulkMode()
Returns the repository's bulkMode setting.
|
boolean |
isWritable()
Returns true iff this repository is writable.
|
void |
setBulkMode(boolean bulkMode)
Sets the repository's bulkMode (defaults to false).
|
void |
setConnPool(AGConnPool pool)
Sets the connection pool to use with this repository.
|
void |
setDataDir(File dataDir)
Deprecated.
not applicable to AllegroGraph
|
void |
setDuplicateSuppressionPolicy(String policy)
Sets the repository's duplicate suppression policy.
|
initialize, isInitialized, shutDown
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize, isInitialized, shutDown
public AGRepository(AGCatalog catalog, String repositoryID)
Preferred access is from AGCatalog
methods
such as AGCatalog.createRepository(String, boolean)
or AGCatalog.openRepository(String)
.
catalog
- the catalog in which to create the repositoryrepositoryID
- the name of the repositorypublic AGCatalog getCatalog()
getCatalog
in interface AGAbstractRepository
public String getRepositoryID()
public String getCatalogPrefixedRepositoryID()
public String getRepositoryURL()
public AGValueFactory getValueFactory()
getValueFactory
in interface AGAbstractRepository
getValueFactory
in interface Repository
public AGHTTPClient getHTTPClient()
AGHTTPClient
The http connection to AllegroGraph serverpublic AGRepositoryConnection getConnection(ScheduledExecutorService executor) throws RepositoryException
getConnection
in interface AGAbstractRepository
executor
- Executor service used to schedule maintenance tasks,
such as calling ping() periodically.
Set to null to disable such tasks.
Call getConnection()
to use the default executor
specified by the server object.
This argument is ignored if connection pooling is usedRepositoryException
public AGRepositoryConnection getConnection() throws RepositoryException
getConnection
in interface AGAbstractRepository
getConnection
in interface Repository
RepositoryException
public boolean isWritable() throws RepositoryException
isWritable
in interface Repository
RepositoryException
public String getSpec()
getSpec
in interface AGAbstractRepository
public File getDataDir()
getDataDir
in interface Repository
public void setDataDir(File dataDir)
setDataDir
in interface Repository
public void close() throws RepositoryException
AbstractRepository.shutDown()
.close
in interface Closeable
close
in interface AutoCloseable
RepositoryException
public boolean isBulkMode() throws RepositoryException
RepositoryException
- if there is an error during the requestsetBulkMode(boolean)
public void setBulkMode(boolean bulkMode) throws RepositoryException
When in bulkMode, data can be added/loaded more quickly, but there is no guarantee of durability in the event of a crash. The bulkMode setting persists when the repository is closed.
bulkMode
- boolean indicating the intended bulkModeRepositoryException
- if there is an error during the requestisBulkMode()
public String getDuplicateSuppressionPolicy() throws RepositoryException
RepositoryException
- if there is an error during the requestsetDuplicateSuppressionPolicy(String)
public void setDuplicateSuppressionPolicy(String policy) throws RepositoryException
This determines how/whether duplicates will be automatically removed at commit time.
Legal policy names are "false" (turns automatic suppression off), "spo" (removes statements with the same s, p, and o), and "spog" (compares s, p, o, and g).
For on-demand duplicate deletion, see
AGRepositoryConnection.deleteDuplicates(String)
.
See also the protocol documentation for suppressing duplicates.
policy
- name of the suppression policy to useRepositoryException
- if there is an error during the requestgetDuplicateSuppressionPolicy()
public void setConnPool(AGConnPool pool)
Enables the repository to use a connection pool so that Sesame apps can transparently benefit from connection pooling. If pool is not null, getConnection() borrows a connection from the pool, and closing the connection returns it to the pool. The pool is closed when the Repository is shutdown.
Note that the AGConnPool parameters:
AGConnProp.serverUrl, "http://localhost:10035",
AGConnProp.username, "test",
AGConnProp.password, "xyzzy",
AGConnProp.catalog, "/",
AGConnProp.repository, "my_repo",
are currently assumed to match those of this repository.
pool
- the pool to use with this repositoryAGConnPool
public void forceCheckpoint() throws RepositoryException
This is an internal and undocumented function.
RepositoryException
- if there is an error during the requestpublic void ensureDBIdle() throws RepositoryException
This is an internal and undocumented function.
RepositoryException
- if there is an error during the requestCopyright © 2018 Franz Inc.. All rights reserved.