public class DelegatingAdminConnection extends com.google.common.collect.ForwardingObject implements AdminConnection
NO_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
DelegatingAdminConnection(AdminConnection theConnection) |
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,
Optional<String> theBackupUrl,
Options theOptions)
Create a backup of the given database in the specified location.
|
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.
|
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.
|
Map<String,Object> |
currentStatus(Options theOptions)
Return the server status information, including Server/Protocols running, Stardog Home path, OS, etc.
|
protected AdminConnection |
delegate() |
void |
disableEncryption(String thePassPhrase)
Stop the server from using data encryption on all future data.
|
DatabaseBuilder |
disk(String theName)
Deprecated.
|
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
|
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 theBackup,
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 theName)
Verify the integrity of specified database's index.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
backup, backup, backup, currentStatus, optimize
protected DelegatingAdminConnection(AdminConnection theConnection)
@Deprecated public DatabaseBuilder builder(Metadata theOptions) throws StardogException
builder
in interface AdminConnection
StardogException
- if there was an error while creating the db@Deprecated public DatabaseBuilder disk(String theName) throws StardogException
disk
in interface AdminConnection
theName
- the name of the disk database to createStardogException
- if the name of the database is invalidprotected AdminConnection delegate()
delegate
in class com.google.common.collect.ForwardingObject
public <T extends AdminConnection> T as(Class<T> theView) throws StardogException
as
in interface AdminConnection
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.public void close() throws StardogException
close
in interface AdminConnection
close
in interface AutoCloseable
StardogException
- if there was an error while closingpublic boolean isOpen() throws StardogException
isOpen
in interface AdminConnection
StardogException
- if there was an error with the connectionpublic DatabaseBuilder newDatabase(String theName) throws StardogException
newDatabase
in interface AdminConnection
theName
- the name of the database to createStardogException
- if the name of the database is invalidpublic Metadata 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.get
in interface AdminConnection
theName
- database nametheOptions
- options for which values will be retrievedStardogException
- if an error occurs while retrieving option valuespublic <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, AdminConnection.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.get
in interface AdminConnection
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 valuepublic <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
.set
in interface AdminConnection
T
- type of the option valuetheName
- name of the databasetheOption
- option to settheValue
- option valueStardogException
- if an error occurs trying to set the option valuepublic Metadata getProperty(Collection<String> thePropertyNames) throws StardogException
getProperty
in interface AdminConnection
StardogException
public String setProperty(String thePropertyName, String theNewValue) throws StardogException
setProperty
in interface AdminConnection
StardogException
public 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.
offline
in interface AdminConnection
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 databasepublic String offline(String theName) throws StardogException
offline
in interface AdminConnection
StardogException
public String online(String theName) throws StardogException
online
in interface AdminConnection
theName
- the name of the databaseStardogException
- if there was an error while onlining the databasepublic String 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.
optimize
in interface AdminConnection
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 optimizationpublic Collection<String> list() throws StardogException
list
in interface AdminConnection
StardogException
- if there was an error getting the listpublic String repair(String theName) throws StardogException
repair
in interface AdminConnection
theName
- the name of the database to repairStardogException
- if there was an error while repairingpublic String verify(String theName) throws StardogException
verify
in interface AdminConnection
theName
- the name of the database to verifyStardogException
- if there was an error while verifying the databasepublic void shutdown() throws com.complexible.stardog.security.StardogSecurityException
shutdown
in interface AdminConnection
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.public String drop(String theName) throws StardogException
drop
in interface AdminConnection
theName
- the name of the database to dropStardogException
- if there was an error while dropping the databasepublic void setEncryptionPassword(String thePassword) throws StardogException
setEncryptionPassword
in interface AdminConnection
thePassword
- the password that will protect the encryption keysStardogException
public void changeEncryptionPassword(String theOldPassword, String theNewPassword) throws StardogException
changeEncryptionPassword
in interface AdminConnection
theOldPassword
- the current passwordtheNewPassword
- the new passwordStardogException
public void removeEncryptionPassword(String thePassword) throws StardogException
removeEncryptionPassword
in interface AdminConnection
thePassword
- the current passwordStardogException
public void createNewEncryptionKey(String thePassPhrase, String keyName) throws StardogException
createNewEncryptionKey
in interface AdminConnection
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
public void disableEncryption(String thePassPhrase) throws StardogException
disableEncryption
in interface AdminConnection
thePassPhrase
- the current encryption password. If no password is in use this
can be an empty stringStardogException
public Collection<String> fileKeyList(String thePassPhrase) throws StardogException
fileKeyList
in interface AdminConnection
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.public String backupAll() throws StardogException
AdminConnection
backupAll
in interface AdminConnection
StardogException
- if there is an error performing the backup.public String backupAll(String theLocation) throws StardogException
AdminConnection
backupAll
in interface AdminConnection
theLocation
- where to store the backupStardogException
- if there is an error performing the backup.public String backupAll(File theLocation) throws StardogException
AdminConnection
backupAll
in interface AdminConnection
theLocation
- where to store the backupStardogException
- if there is an error performing the backup.public String backup(String theDatabase, Optional<String> theBackupUrl, Options theOptions) throws StardogException
Configuration options
can be specified for the backup operation.backup
in interface AdminConnection
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
public String restore(File theBackup, boolean theOverwrite, String theName) throws StardogException
restore
in interface AdminConnection
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 backuppublic String restore(String theBackup, boolean theOverwrite, String theName) throws StardogException
restore
in interface AdminConnection
StardogException
public UserManager getUserManager()
UserManager
to be used for user-centric security changesgetUserManager
in interface AdminConnection
public RoleManager getRoleManager()
RoleManager
to be used for role-centric security changesgetRoleManager
in interface AdminConnection
public PermissionManager getPermissionManager()
PermissionManager
for changing user & role permissionsgetPermissionManager
in interface AdminConnection
public QueryManager getQueryManager()
QueryManager
for managing running queriesgetQueryManager
in interface AdminConnection
public Map<String,Object> currentStatus(Options theOptions) throws StardogException
AdminConnection
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
.currentStatus
in interface AdminConnection
theOptions
- the options for customizing the metrics that will be returnedStardogException
- if there was an error retrieving the DBMS infoMetricOptions
public StoredQueries getStoredQueries()
AdminConnection
getStoredQueries
in interface AdminConnection
public com.complexible.stardog.StoredFunctions getStoredFunctions()
AdminConnection
getStoredFunctions
in interface AdminConnection
Copyright © 2010-2016 Stardog Union. All Rights Reserved.