public class BdbServerAdmin
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
closeDatabaseHandles(java.lang.String envHome,
java.lang.String fileName,
java.lang.String databaseName,
long minIdleInMilli)
Close database handles which are opened for the specified file and
database name under the specified environment and which have not been
accessed for at least the specified idle time.
|
void |
closeEnvironmentHandles(java.lang.String home,
long minIdleInMilli)
Close environment handles which are opened for the specified environment
and which have not been accessed for at least the specified idle time.
|
void |
deleteEnvironmentAndDatabases(java.lang.String home,
boolean force)
Delete all files created for the environment at the specified home
directory, and all database files created under the environment.
|
java.lang.String |
getServerBdbVersion()
Return the BDB library release version hosted by the server.
|
default <V> V |
handleRuntimeExceptions(com.sleepycat.client.RemoteServiceCallable<V> remote) |
void |
ping()
Check if the server is reachable and responsive.
|
default <V> V |
remoteCall(com.sleepycat.client.RemoteServiceCallable<V> remote) |
default <V> V |
remoteCallWithIOException(com.sleepycat.client.RemoteServiceCallable<V> remote) |
void |
shutdownServer()
Request to shutdown the server.
|
public void ping() throws SDatabaseException
SDatabaseException
- if any error occurspublic java.lang.String getServerBdbVersion() throws SDatabaseException
SDatabaseException
- if any error occurspublic void shutdownServer() throws SDatabaseException
After this method. All connections to the server and all objects created from them must be discarded.
SDatabaseException
- if any error occurspublic void closeEnvironmentHandles(java.lang.String home, long minIdleInMilli) throws SDatabaseException
Before an environment handle is closed, all handles that depend on it are close first. If a close operation fails, this method continues to close the rest of handles and throw the first exception occurred.
home
- the environment's home directory as a relative pathminIdleInMilli
- the idle time in milliseconds, environment handles
which have not been accessed for at least this time are closedSDatabaseException
- if any error occurspublic void deleteEnvironmentAndDatabases(java.lang.String home, boolean force) throws java.io.IOException, SDatabaseException
If force
is true, all handles opened for the environment and all
handles created from them are closed before files are deleted. If force
is false and there is at least one handle opened for the
environment, SResourceInUseException
is thrown.
home
- the environment's home directory as a relative pathforce
- if true, open handles for the environments are closed so
that environment files can be deleted; otherwise, this operation fails
with a SResourceInUseException if there is at least one open handle for
the environmentjava.io.FileNotFoundException
- if no environment exists at the specified
home directoryjava.io.IOException
- if any I/O error occursSResourceInUseException
- if force
is false and there is
at least one open handle for the environmentSDatabaseException
- if any error occurspublic void closeDatabaseHandles(java.lang.String envHome, java.lang.String fileName, java.lang.String databaseName, long minIdleInMilli) throws SDatabaseException
databaseName
is not specified, handles for all databases in the file are closed if
they have not been accessed for at least the specified idle time.
Before a database handle is closed, all handles that depend on it are close first. If a close operation fails, this method continues to close the rest of handles and throw the first exception occurred.
envHome
- the environment home directory as a relative pathfileName
- the database file namedatabaseName
- the database nameminIdleInMilli
- the idle time in milliseconds, database handles
which have not been accessed for at least this time are closedSDatabaseException
- if any error occurspublic <V> V remoteCallWithIOException(com.sleepycat.client.RemoteServiceCallable<V> remote) throws java.io.IOException
java.io.IOException
public <V> V remoteCall(com.sleepycat.client.RemoteServiceCallable<V> remote)
public <V> V handleRuntimeExceptions(com.sleepycat.client.RemoteServiceCallable<V> remote) throws org.apache.thrift.TException
org.apache.thrift.TException
Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.