db4o 8.0

com.db4o.cs
Class Db4oClientServer

java.lang.Object
  extended by 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
static int ARBITRARY_PORT
           
 
Constructor Summary
Db4oClientServer()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARBITRARY_PORT

public static final int ARBITRARY_PORT
See Also:
Constant Field Values
Constructor Detail

Db4oClientServer

public Db4oClientServer()
Method Detail

newServerConfiguration

public static ServerConfiguration newServerConfiguration()
creates a new ServerConfiguration


openServer

public static ObjectServer openServer(ServerConfiguration config,
                                      java.lang.String databaseFileName,
                                      int port)
opens an ObjectServer on the specified database file and port.

Parameters:
config - a custom ServerConfiguration instance to be obtained via newServerConfiguration()
databaseFileName - an absolute or relative path to the database file
port - 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().
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 - 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.
See Also:
Configuration#readOnly, Configuration#encrypt, Configuration#password

openServer

public static ObjectServer openServer(java.lang.String databaseFileName,
                                      int port)
opens a db4o server with a fresh server configuration.

See Also:
openServer(ServerConfiguration, String, int), newServerConfiguration()

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 used
host - the host name of the server that is to be connected to
port - the server port to connect to
user - the username for authentication
password - 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.

See Also:
openClient(ClientConfiguration, String, int, String, String), newClientConfiguration()

newClientConfiguration

public static ClientConfiguration newClientConfiguration()
creates a new ClientConfiguration


db4o 8.0

Copyright 2009 Versant Corporation. All rights reserved.