public interface AdminConnection extends AutoCloseable
A connection to the Stardog DBMS allowing access to the administrative functions provided by Stardog.
Any methods which return Strings are the information output returned from the server as a result of the invocation.
| Modifier and Type | Field and Description |
|---|---|
static long |
NO_TIMEOUT
Constant for specifying no timeout when
offlining a database. |
| Modifier and Type | Method and Description |
|---|---|
<T extends AdminConnection> |
as(Class<T> theView)
Return this admin connection viewed as a different type of admin connection.
|
String |
backup(String theDatabase)
Create a backup of the given database to the default location.
|
String |
backup(String theDatabase,
File theLocation)
Create a backup of the given database in the specified location.
|
String |
backup(String theDatabase,
String theBackupUrl) |
String |
backupAll(File theLocation)
Create a backup of the given database in the specified location.
|
DatabaseBuilder |
builder(Metadata theOptions)
Deprecated.
To be removed in 5.1
|
void |
close()
Close this connection.
|
Map<String,Object> |
currentStatus(boolean theIncludeDbStatus)
Return the DBMS status information, including Server/Protocols running, Stardog Home path, OS, etc
|
DatabaseBuilder |
disk(String theName)
Deprecated.
Use
newDatabase(String) instead |
String |
drop(String theName)
Drop the database with the given name.
|
Metadata |
get(String theName,
Iterable<? extends MetaProperty<?>> theOptions)
Gets the values of the specified options in the given database.
|
<T> T |
get(String theName,
MetaProperty<T> theOption)
Gets the value of the specified option in the given database.
|
PermissionManager |
getPermissionManager()
Return the
PermissionManager for changing user & role permissions |
QueryManager |
getQueryManager()
Return the
QueryManager for managing running queries |
RoleManager |
getRoleManager()
Return the
RoleManager to be used for role-centric security changes |
com.complexible.stardog.StoredFunctions |
getStoredFunctions()
Returns the stored functions in this server.
|
StoredQueries |
getStoredQueries()
Returns the stored queries in this server.
|
UserManager |
getUserManager()
Return the
UserManager to be used for user-centric security changes |
boolean |
isOpen()
Return whether or not this connection is open.
|
Collection<String> |
list()
List all of the databases in the Stardog server
|
DatabaseBuilder |
newDatabase(String theName)
Create a builder for creating a new database.
|
String |
offline(String theName)
Makes the database offline according to the default strategy and default timeout.
|
String |
offline(String theName,
long theTime,
TimeUnit theTimeUnit)
Take the database offline waiting up to the specified timeout before performing a hard off-line.
|
String |
online(String theName)
Makes the database online according to the default strategy
|
default String |
optimize(String theName)
Optimizes the database with default options. |
String |
optimize(String theName,
Metadata theOptions)
Optimizes the indexes of a given database for query answering and disk utilization after the database has been heavily modified.
|
String |
repair(String theName)
Repairs the specified database if it is corrupted.
|
String |
restore(File theBackup,
boolean theOverwrite,
String theName)
Restore the database backed up to the given location
|
String |
restore(String theBackupUrl,
boolean theOverwrite,
String theName) |
String |
restoreAll(File theBackup)
Restore the database backed up to the given location
|
<T> String |
set(String theName,
MetaProperty<T> theOption,
T theValue)
Sets the value of the specified option for the database with the given name.
|
void |
shutdown()
Shutdown the remote Stardog server.
|
static final long NO_TIMEOUT
offlining a database.<T extends AdminConnection> T as(Class<T> theView) throws StardogException
T - the connection view to returntheView - the type of connection to view this object asStardogException - if the connection cannot be viewed as the provided type. This could be from the
parent connection having been closed or it does not support the provided view.void close()
throws StardogException
close in interface AutoCloseableStardogException - if there was an error while closingboolean isOpen()
throws StardogException
StardogException - if there was an error with the connection@Deprecated DatabaseBuilder builder(Metadata theOptions) throws StardogException
StardogException - if there was an error while creating the db@Deprecated DatabaseBuilder disk(String theName) throws StardogException
newDatabase(String) insteadtheName - the name of the disk database to createStardogException - if the name of the database is invalidDatabaseBuilder newDatabase(String theName) throws StardogException
theName - the name of the database to createStardogException - if the name of the database is invalidMetadata get(String theName, Iterable<? extends MetaProperty<?>> theOptions) throws StardogException
contain all the specified options. Only the values for
known Stardog options that are should be
readable will be contained in the result. This function will throw an
exception if the user does not have read access to the database metadata.theName - database nametheOptions - options for which values will be retrievedStardogException - if an error occurs while retrieving option values<T> T get(String theName, MetaProperty<T> theOption) throws StardogException
null if the
option is NOT a known Stardog options, or if it is NOT
readable. The function may also return null if the option is set
to null value for the database. To differentiate these cases, get(String, Iterable)
function can be used instead. This function will throw an exception if the user does not have read access to the
database metadata.T - type of the option valuetheName - name of the databasetheOption - the option to getnull as explained aboveStardogException - if there was an error while getting the value<T> String set(String theName, MetaProperty<T> theOption, T theValue) throws StardogException
known Stardog option,
the provided value should be valid, and
either the option should be writable online
or it should be writable
and the database should NOT be online.T - type of the option valuetheName - name of the databasetheOption - option to settheValue - option valueStardogException - if an error occurs trying to set the option valueString offline(String theName, long theTime, TimeUnit theTimeUnit) throws StardogException
Take the database offline waiting up to the specified timeout before performing a hard off-line. A database going offline will allow open connections to complete, but will not accept new, incoming connections.
Offline databases cannot be queried or updated and will be unaccessible to users.
Specifying a timeout of 0 will immediately shut down the database severing all open connections, i.e. a hard shutdown.
theName - name of the databasetheTime - timeout duration, must be a positive numbertheTimeUnit - the unit of time for the timeout, cannot be nullStardogException - if there was an error while offlining the databaseString offline(String theName) throws StardogException
StardogExceptionString online(String theName) throws StardogException
theName - the name of the databaseStardogException - if there was an error while onlining the databasedefault String optimize(String theName) throws StardogException
Optimizes the database with default options.theName - the name of the database to optimizeStardogException - if an error occurs during optimizationString optimize(String theName, Metadata theOptions) throws StardogException
Optimization will NOT modify the database contents. The data layout, indexes and other internal structures might change but the data stored in the database will remain same.
theName - the name of the database to optimizetheOptions - options specifying the specific optimization steps to perform or empty for default optimizationsStardogException - if an error occurs during optimizationCollection<String> list() throws StardogException
StardogException - if there was an error getting the listString repair(String theName) throws StardogException
theName - the name of the database to repairStardogException - if there was an error while repairingvoid shutdown()
throws com.complexible.stardog.security.StardogSecurityException
com.complexible.stardog.security.StardogSecurityException - if you are attempting to shut down
the embedded server or if you are not a
super-user and are trying to shut down a
remote server.String drop(String theName) throws StardogException
theName - the name of the database to dropStardogException - if there was an error while dropping the databaseString backup(String theDatabase) throws StardogException
theDatabase - the name of the database to back upStardogException - if there is an error performing the backup.String backup(String theDatabase, File theLocation) throws StardogException
theDatabase - the name of the database to back uptheLocation - where to store the backupStardogException - if there is an error performing the backup.String backup(String theDatabase, String theBackupUrl) throws StardogException
StardogExceptionString backupAll(File theLocation) throws StardogException
theLocation - where to store the backupStardogException - if there is an error performing the backup.String restore(File theBackup, boolean theOverwrite, String theName) throws StardogException
theBackup - the location of the backuptheOverwrite - whether or not to overwrite any existing databasetheName - a new name for the restored databaseStardogException - if there was an error restoring the database from a backupString restore(String theBackupUrl, boolean theOverwrite, String theName) throws StardogException
StardogExceptionString restoreAll(File theBackup) throws StardogException
theBackup - the location of the backupStardogException - if there was an error restoring the database from a backupUserManager getUserManager()
UserManager to be used for user-centric security changesRoleManager getRoleManager()
RoleManager to be used for role-centric security changesPermissionManager getPermissionManager()
PermissionManager for changing user & role permissionsQueryManager getQueryManager()
QueryManager for managing running queriesMap<String,Object> currentStatus(boolean theIncludeDbStatus) throws StardogException
theIncludeDbStatus - if true the database status information about each database is includedStardogException - if there was an error retrieving the DBMS infoStoredQueries getStoredQueries()
com.complexible.stardog.StoredFunctions getStoredFunctions()
Copyright © 2010-2016 Stardog Union. All Rights Reserved.