Package com.db4o.cs
Class Db4oClientServer
- java.lang.Object
-
- com.db4o.cs.Db4oClientServer
-
public class Db4oClientServer extends java.lang.Object
Factory class to open db4o servers and to connect db4o clients to them.
Note:
This class is made available in db4o-X.x-cs-java.jar / Db4objects.Db4o.CS.dll- Since:
- 7.5
-
-
Field Summary
Fields Modifier and Type Field Description static int
ARBITRARY_PORT
-
Constructor Summary
Constructors Constructor Description Db4oClientServer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClientConfiguration
newClientConfiguration()
creates a newClientConfiguration
static ServerConfiguration
newServerConfiguration()
creates a newServerConfiguration
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 anObjectServer
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.
-
-
-
Field Detail
-
ARBITRARY_PORT
public static final int ARBITRARY_PORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
newServerConfiguration
public static ServerConfiguration newServerConfiguration()
creates a newServerConfiguration
-
openServer
public static ObjectServer openServer(ServerConfiguration config, java.lang.String databaseFileName, int port)
- Parameters:
config
- a customServerConfiguration
instance to be obtained vianewServerConfiguration()
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 - seeExtObjectServer.port()
.- Returns:
- an
ObjectServer
listening on the specified port. - Throws:
Db4oIOException
- I/O operation failed or was unexpectedly interrupted.DatabaseFileLockedException
- the required database file is locked by another process.IncompatibleFileFormatException
- runtimeOldFormatException
- open operation failed because the database file is in old format andConfiguration.allowVersionUpdates(boolean)
is set to false.DatabaseReadOnlyException
- database was configured as read-only.
-
openServer
public static ObjectServer openServer(java.lang.String databaseFileName, int port)
opens a db4o server with a fresh server configuration.
-
openClient
public 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.- Parameters:
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 authentication- Throws:
java.lang.IllegalArgumentException
- if the configuration passed in has already been used.- See Also:
openServer(ServerConfiguration, String, int)
,ObjectServer.grantAccess(String, String)
-
openClient
public 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.
-
newClientConfiguration
public static ClientConfiguration newClientConfiguration()
creates a newClientConfiguration
-
-