|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.clarkparsia.stardog.StardogDBMS
public final class StardogDBMS
Administrative management functions for working with the Stardog database system.
Any methods which return Strings are the information output returned from the server as a result of the invocation.
StardogDBMS should not be used by multiple threads at the same time.
| Nested Class Summary | |
|---|---|
static class |
StardogDBMS.LoginConfiguration
Simple class to log into StardogDBMS. |
| Field Summary | |
|---|---|
static char[] |
DEFAULT_PASSWD
Constant for username used to create a connection when no username or password is present |
static String |
DEFAULT_USERNAME
Constant for username used to create a connection when no username or password is present |
static String |
EMBEDDED_SERVER_URL
Constant for the embedded server URL |
static long |
NO_TIMEOUT
|
| Method Summary | ||
|---|---|---|
DatabaseBuilder |
builder(Metadata theOptions)
Convenience method to create a database builder with the given options. |
|
String |
copy(String theName,
String theCopyName)
Copy a database under a new name. |
|
ConnectionConfiguration |
createMemory(String theName)
Convenience method to create a temporary in-memory only database with the given name |
|
DatabaseBuilder.DiskDatabaseBuilder |
disk(String theName)
Create a new builder for creating disk databases |
|
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. |
|
|
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 |
|
com.clarkparsia.stardog.QueryManager |
getQueryManager()
Return the QueryManager for managing running queries |
|
RoleManager |
getRoleManager()
Return the RoleManager to be used for role-centric security changes |
|
UserManager |
getUserManager()
Return the UserManager to be used for user-centric security changes |
|
boolean |
isOpen()
|
|
Collection<String> |
list()
List all of the databases in the Stardog server |
|
static StardogDBMS |
login(String theUsername,
char[] thePassword)
Deprecated. Use toEmbeddedServer() instead |
|
static StardogDBMS |
login(String theURL,
String theUsername,
char[] thePassword)
Deprecated. Use toServer(String) instead |
|
void |
logout()
Log out of the Stardog server and close the client. |
|
DatabaseBuilder.MemDatabaseBuilder |
memory(String theName)
Create a new builder for creating in-memory databases |
|
String |
migrate(String theName)
Migrate the specified database to the most current on-disk format. |
|
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 befor performing a hard off-line. |
|
String |
offline(String theName,
com.clarkparsia.stardog.OnlineOfflineStrategyType theStrategyType)
Deprecated. will be removed in Stardog 1.3, use offline(String, long, TimeUnit) |
|
String |
offline(String theName,
com.clarkparsia.stardog.OnlineOfflineStrategyType theStrategyType,
long theTimeOutInMs)
Deprecated. will be removed in Stardog 1.3, use offline(String, long, TimeUnit) |
|
String |
online(String theName)
Makes the database online according to the default strategy |
|
String |
online(String theName,
com.clarkparsia.stardog.OnlineOfflineStrategyType theStrategyType)
Deprecated. will be removed in Stardog 1.3, use online(String) |
|
String |
optimize(String theName)
Optimizes the indexes of a given database for query answering after the database has been modified. |
|
|
set(String theName,
ConfigProperty<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 void |
startEmbeddedServer()
Start the local in-JVM Stardog server. |
|
static void |
stopEmbeddedServer()
Shut down the local in-JVM Stardog server if it is running. |
|
static StardogDBMS.LoginConfiguration |
toEmbeddedServer()
Returns a StardogDBMS.LoginConfiguration to log into the local embedded server. |
|
static StardogDBMS.LoginConfiguration |
toServer(String theURL)
Returns a StardogDBMS.LoginConfiguration to log into the local embedded server. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String EMBEDDED_SERVER_URL
public static final String DEFAULT_USERNAME
public static final char[] DEFAULT_PASSWD
public static final long NO_TIMEOUT
| Method Detail |
|---|
public static void startEmbeddedServer()
throws StardogException
StardogException - if there was an error while starting the serverpublic static void stopEmbeddedServer()
startEmbeddedServer()public static StardogDBMS.LoginConfiguration toEmbeddedServer()
StardogDBMS.LoginConfiguration to log into the local embedded server.
public static StardogDBMS.LoginConfiguration toServer(String theURL)
StardogDBMS.LoginConfiguration to log into the local embedded server.
public static StardogDBMS login(String theUsername,
char[] thePassword)
throws StardogException
toEmbeddedServer() instead
theUsername - the user to log in asthePassword - the password for the user
StardogException - if the login failed, or the connection could not be established
public static StardogDBMS login(String theURL,
String theUsername,
char[] thePassword)
throws StardogException
toServer(String) instead
theURL - the url of the stardog server. if the url does not contain any port value then the default
port Protocol.DEFAULT_PORT will be usedtheUsername - the user name to be used to log inthePassword - the password to be use to authenticate the user
StardogException - if the login failed, or the connection could not be establishedpublic UserManager getUserManager()
UserManager to be used for user-centric security changes
public RoleManager getRoleManager()
RoleManager to be used for role-centric security changes
public PermissionManager getPermissionManager()
PermissionManager for changing user & role permissions
public com.clarkparsia.stardog.QueryManager getQueryManager()
QueryManager for managing running queries
public void logout()
public boolean isOpen()
public DatabaseBuilder builder(Metadata theOptions)
throws StardogException
StardogException - if there was an error while creating the db
public ConnectionConfiguration createMemory(String theName)
throws StardogException
theName - the name of the database to create
ConnectionConfiguration to use to connect to the new database
StardogException - if there was an error while creating the db
public DatabaseBuilder.MemDatabaseBuilder memory(String theName)
throws StardogException
theName - the name of the database to be created
StardogException - if the name of the database is invalid
public DatabaseBuilder.DiskDatabaseBuilder disk(String theName)
throws StardogException
theName - the name of the disk database to create
StardogException - if the name of the database is invalid
public String drop(String theName)
throws StardogException
theName - the name of the database to drop
StardogException - if there was an error while dropping the database
public <T> void set(String theName,
ConfigProperty<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 value
StardogException - if an error occurs trying to set the option value
public <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 get
null as explained above
StardogException
public 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.
theName - database nametheOptions - options for which values will be retrieved
StardogException - if an error occurs while retrieving option values
public String optimize(String theName)
throws StardogException
theName - the name of the database to optimize
StardogException - if an error occurs during optimization
public String online(String theName)
throws StardogException
theName - the name of the database
StardogException - if there was an error while onlining the database
@Deprecated
public String online(String theName,
com.clarkparsia.stardog.OnlineOfflineStrategyType theStrategyType)
throws StardogException
online(String)
theName - name of the databasetheStrategyType - strategy of how the database should be taken online
StardogException - if an error occurs during onlining the database
public String offline(String theName)
throws StardogException
StardogException
@Deprecated
public String offline(String theName,
com.clarkparsia.stardog.OnlineOfflineStrategyType theStrategyType)
throws StardogException
offline(String, long, TimeUnit)
StardogException
@Deprecated
public String offline(String theName,
com.clarkparsia.stardog.OnlineOfflineStrategyType theStrategyType,
long theTimeOutInMs)
throws StardogException
offline(String, long, TimeUnit)
theName - name of the databasetheStrategyType - offline strategy typetheTimeOutInMs - timeout in milliseconds
StardogException - if there was an error while offlining the database
public String offline(String theName,
long theTime,
TimeUnit theTimeUnit)
throws StardogException
Take the database offline waiting up to the specified timeout befor 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 null
StardogException - if there was an error while offlining the database
public String copy(String theName,
String theCopyName)
throws StardogException
theName - name of the database to copytheCopyName - name of the new database that will be created
StardogException - if an error occurs during copy
public Collection<String> list()
throws StardogException
StardogException - if there was an error getting the list
public void shutdown()
throws com.clarkparsia.stardog.security.StardogSecurityException
stopEmbeddedServer().
com.clarkparsia.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 migrate(String theName)
throws StardogException
theName - the name of the database to migrate
StardogException - if there was an error while migrating
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||