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)
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 theRestoreUrl) |
String |
backupAll(File theLocation)
Create a backup of the given database in the specified location.
|
DatabaseBuilder |
builder(Metadata theOptions)
Deprecated.
|
void |
close()
Close this connection.
|
String |
copy(String theName,
String theCopyName)
Copy a database under a new name.
|
ConnectionConfiguration |
createMemory(String theName)
Deprecated.
|
Map<String,Object> |
currentStatus(boolean theIncludeDbStatus)
Return the DBMS status information, including Server/Protocols running, Stardog Home path, OS, etc
|
protected AdminConnection |
delegate() |
DatabaseBuilder |
disk(String theName)
Deprecated.
|
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 |
memory(String theName)
Deprecated.
|
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)
Optimizes the indexes of a given database for query answering after the database has been 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 theBackup,
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.
|
protected DelegatingAdminConnection(AdminConnection theConnection)
@Deprecated public DatabaseBuilder builder(Metadata theOptions) throws StardogException
builder in interface AdminConnectionStardogException - if there was an error while creating the db@Deprecated public ConnectionConfiguration createMemory(String theName) throws StardogException
Convenience method to create a non-persistent in-memory database with the given name and the default settings.
This is equivalent to calling memory(theName).create().
createMemory in interface AdminConnectiontheName - the name of the database to createConnectionConfiguration to use to connect to the new databaseStardogException - if there was an error while creating the db@Deprecated public DatabaseBuilder disk(String theName) throws StardogException
disk in interface AdminConnectiontheName - the name of the disk database to createStardogException - if the name of the database is invalid@Deprecated public DatabaseBuilder memory(String theName) throws StardogException
memory in interface AdminConnectiontheName - the name of the database to be createdStardogException - if the name of the database is invalidprotected AdminConnection delegate()
delegate in class com.google.common.collect.ForwardingObjectpublic <T extends AdminConnection> T as(Class<T> theView) throws StardogException
as in interface AdminConnectionT - 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 AdminConnectionclose in interface AutoCloseableStardogException - if there was an error while closingpublic boolean isOpen()
throws StardogException
isOpen in interface AdminConnectionStardogException - if there was an error with the connectionpublic DatabaseBuilder newDatabase(String theName) throws StardogException
newDatabase in interface AdminConnectiontheName - 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 AdminConnectiontheName - 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 AdminConnectionT - 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 AdminConnectionT - type of the option valuetheName - name of the databasetheOption - option to settheValue - option valueStardogException - if an error occurs trying to set the option valuepublic 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 AdminConnectiontheName - 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 AdminConnectionStardogExceptionpublic String online(String theName) throws StardogException
online in interface AdminConnectiontheName - the name of the databaseStardogException - if there was an error while onlining the databasepublic String optimize(String theName) throws StardogException
optimize in interface AdminConnectiontheName - the name of the database to optimizeStardogException - if an error occurs during optimizationpublic Collection<String> list() throws StardogException
list in interface AdminConnectionStardogException - if there was an error getting the listpublic String copy(String theName, String theCopyName) throws StardogException
copy in interface AdminConnectiontheName - name of the database to copytheCopyName - name of the new database that will be createdStardogException - if an error occurs during copypublic String repair(String theName) throws StardogException
repair in interface AdminConnectiontheName - the name of the database to repairStardogException - if there was an error while repairingpublic void shutdown()
throws com.complexible.stardog.security.StardogSecurityException
shutdown in interface AdminConnectioncom.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 AdminConnectiontheName - the name of the database to dropStardogException - if there was an error while dropping the databasepublic String backup(String theDatabase) throws StardogException
backup in interface AdminConnectiontheDatabase - the name of the database to back upStardogException - if there is an error performing the backup.public String backup(String theDatabase, File theLocation) throws StardogException
backup in interface AdminConnectiontheDatabase - the name of the database to back uptheLocation - where to store the backupStardogException - if there is an error performing the backup.public String backupAll(File theLocation) throws StardogException
AdminConnectionbackupAll in interface AdminConnectiontheLocation - where to store the backupStardogException - if there is an error performing the backup.public String backup(String theDatabase, String theRestoreUrl) throws StardogException
backup in interface AdminConnectionStardogExceptionpublic String restore(File theBackup, boolean theOverwrite, String theName) throws StardogException
restore in interface AdminConnectiontheBackup - 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 AdminConnectionStardogExceptionpublic String restoreAll(File theBackup) throws StardogException
AdminConnectionrestoreAll in interface AdminConnectiontheBackup - the location of the backupStardogException - if there was an error restoring the database from a backuppublic UserManager getUserManager()
UserManager to be used for user-centric security changesgetUserManager in interface AdminConnectionpublic RoleManager getRoleManager()
RoleManager to be used for role-centric security changesgetRoleManager in interface AdminConnectionpublic PermissionManager getPermissionManager()
PermissionManager for changing user & role permissionsgetPermissionManager in interface AdminConnectionpublic QueryManager getQueryManager()
QueryManager for managing running queriesgetQueryManager in interface AdminConnectionpublic Map<String,Object> currentStatus(boolean theIncludeDbStatus) throws StardogException
AdminConnectioncurrentStatus in interface AdminConnectiontheIncludeDbStatus - if true the database status information about each database is includedStardogException - if there was an error retrieving the DBMS infopublic StoredQueries getStoredQueries()
AdminConnectiongetStoredQueries in interface AdminConnectionpublic com.complexible.stardog.StoredFunctions getStoredFunctions()
AdminConnectiongetStoredFunctions in interface AdminConnectionCopyright © 2010-2016 Stardog Union. All Rights Reserved.