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.
|
default String |
backup(String theDatabase)
Deprecated.
|
default String |
backup(String theDatabase,
File theLocation)
Deprecated.
Use
backup(String, Optional, Options) instead |
String |
backup(String theDatabase,
Optional<String> theBackupUrl,
Options theOptions)
Create a backup of the given database in the specified location.
|
default String |
backup(String theDatabase,
String theBackupUrl)
Deprecated.
Use
backup(String, Optional, Options) instead |
String |
backupAll()
Create a backup of the server to the default location.
|
String |
backupAll(File theLocation)
Create a backup of the server in the specified location.
|
String |
backupAll(String theLocation)
Create a backup of the server in the specified location.
|
DatabaseBuilder |
builder(Metadata theOptions)
Deprecated.
To be removed in 5.1
|
void |
changeEncryptionPassword(String theOldPassword,
String theNewPassword)
Change the user managed encryption password.
|
void |
close()
Close this connection.
|
void |
createNewEncryptionKey(String thePassPhrase,
String keyName)
Add a new key for encrypting data.
|
default Map<String,Object> |
currentStatus(boolean theIncludeDbStatus)
Deprecated.
Use
currentStatus(Options) instead |
Map<String,Object> |
currentStatus(Options theOptions)
Return the server status information, including Server/Protocols running, Stardog Home path, OS, etc.
|
void |
disableEncryption(String thePassPhrase)
Stop the server from using data encryption on all future data.
|
DatabaseBuilder |
disk(String theName)
Deprecated.
Use
newDatabase(String) instead |
String |
drop(String theName)
Drop the database with the given name.
|
Collection<String> |
fileKeyList(String thePassPhrase)
Return the list of keys which have been used for encryption.
|
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 |
Metadata |
getProperty(Collection<String> thePropertyNames)
Gets the property value for a server configuration option.
|
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.
|
void |
removeEncryptionPassword(String thePassword)
Remove the user managed password for the encryption of data.
|
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) |
<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 |
setEncryptionPassword(String thePassword)
Encrypt all data keys against the given password.
|
String |
setProperty(String thePropertyName,
String theNewValue)
Requests that the specified server configuration option value be changed to the new value.
|
void |
shutdown()
Shutdown the remote Stardog server.
|
String |
verify(String theDb)
Verify the integrity of specified database's index.
|
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 AutoCloseable
StardogException
- 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 valueMetadata getProperty(Collection<String> thePropertyNames) throws StardogException
thePropertyNames
- StardogException
String setProperty(String thePropertyName, String theNewValue) throws StardogException
thePropertyName
- theNewValue
- StardogException
String 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
StardogException
String 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 databasevoid setEncryptionPassword(String thePassword)
thePassword
- the password that will protect the encryption keysStardogException
void changeEncryptionPassword(String theOldPassword, String theNewPassword)
theOldPassword
- the current passwordtheNewPassword
- the new passwordStardogException
void removeEncryptionPassword(String thePassword)
thePassword
- the current passwordStardogException
void createNewEncryptionKey(String thePassPhrase, String keyName)
thePassPhrase
- the current encryption password. If no password is in use this
can be an empty stringkeyName
- the name of the key. This must be unique to the systemStardogException
void disableEncryption(String thePassPhrase)
thePassPhrase
- the current encryption password. If no password is in use this
can be an empty stringStardogException
Collection<String> fileKeyList(String thePassPhrase)
thePassPhrase
- the current encryption password. If no password is in use this
can be an empty stringStardogException
- if there is an error performing the backup.@Deprecated default String backup(String theDatabase) throws StardogException
theDatabase
- the name of the database to back upStardogException
- if there is an error performing the backup.@Deprecated default String backup(String theDatabase, File theLocation) throws StardogException
backup(String, Optional, Options)
insteadtheDatabase
- the name of the database to back uptheLocation
- where to store the backupStardogException
- if there is an error performing the backup.@Deprecated default String backup(String theDatabase, String theBackupUrl) throws StardogException
backup(String, Optional, Options)
insteadtheDatabase
- the name of the database to back uptheBackupUrl
- where to store the backupStardogException
- if there is an error performing the backup.String backup(String theDatabase, Optional<String> theBackupUrl, Options theOptions) throws StardogException
Configuration options
can be specified for the backup operation.theDatabase
- the name of the database to back uptheBackupUrl
- where to store the backup or empty if the default location should be usedtheOptions
- configuration options to use for backupsStardogException
String backupAll() throws StardogException
StardogException
- if there is an error performing the backup.String backupAll(String theLocation) throws StardogException
theLocation
- where to store the backupStardogException
- if there is an error performing the backup.String 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
StardogException
UserManager 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 queries@Deprecated default Map<String,Object> currentStatus(boolean theIncludeDbStatus) throws StardogException
currentStatus(Options)
insteadtheIncludeDbStatus
- if true the database status
information about each database is includedStardogException
- if there was an error retrieving the DBMS infoMap<String,Object> currentStatus(Options theOptions) throws StardogException
options
can be used to configure which metrics will be included in the results. The embedded connections do not support
any options other than MetricOptions.DATABASES
.theOptions
- the options for customizing the metrics that will be returnedStardogException
- if there was an error retrieving the DBMS infoMetricOptions
StoredQueries getStoredQueries()
com.complexible.stardog.StoredFunctions getStoredFunctions()
String verify(String theDb)
theDb
- the name of the database to verifyStardogException
- if there was an error while verifying the databaseCopyright © 2010-2016 Stardog Union. All Rights Reserved.