public class Db4oClientServer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ARBITRARY_PORT |
| Constructor and Description |
|---|
Db4oClientServer() |
| Modifier and Type | Method and Description |
|---|---|
static ClientConfiguration |
newClientConfiguration()
creates a new
ClientConfiguration |
static ServerConfiguration |
newServerConfiguration()
creates a new
ServerConfiguration |
static ObjectContainer |
openClient(ClientConfiguration config,
java.lang.String host,
int port,
java.lang.String user,
java.lang.String password)
opens a db4o client instance with the specified configuration.
|
static ObjectContainer |
openClient(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password)
opens a db4o client instance with a fresh client configuration.
|
static ObjectServer |
openServer(ServerConfiguration config,
java.lang.String databaseFileName,
int port)
opens an
ObjectServer
on the specified database file and port. |
static ObjectServer |
openServer(java.lang.String databaseFileName,
int port)
opens a db4o server with a fresh server configuration.
|
public static final int ARBITRARY_PORT
public static ServerConfiguration newServerConfiguration()
ServerConfigurationpublic static ObjectServer openServer(ServerConfiguration config, java.lang.String databaseFileName, int port)
config - a custom ServerConfiguration instance to be obtained via newServerConfiguration()databaseFileName - an absolute or relative path to the database fileport - the port to be used or 0 if the server should not open a port, specify a value < 0 if an arbitrary free port should be chosen - see ExtObjectServer#port().ObjectServer listening
on the specified port.Db4oIOException - I/O operation failed or was unexpectedly interrupted.DatabaseFileLockedException - the required database file is locked by
another process.IncompatibleFileFormatException - runtime
configuration is not compatible
with the configuration of the database file.OldFormatException - open operation failed because the database file
is in old format and Configuration.allowVersionUpdates(boolean)
is set to false.DatabaseReadOnlyException - database was configured as read-only.Configuration#readOnly,
Configuration#encrypt,
Configuration#passwordpublic static ObjectServer openServer(java.lang.String databaseFileName, int port)
public static ObjectContainer openClient(ClientConfiguration config, java.lang.String host, int port, java.lang.String user, java.lang.String password)
config - the configuration to be usedhost - the host name of the server that is to be connected toport - the server port to connect touser - the username for authenticationpassword - the password for authenticationjava.lang.IllegalArgumentException - if the configuration passed in has already been used.openServer(ServerConfiguration, String, int),
ObjectServer.grantAccess(String, String)public static ObjectContainer openClient(java.lang.String host, int port, java.lang.String user, java.lang.String password)
public static ClientConfiguration newClientConfiguration()
ClientConfiguration