Package com.db4o.cs.internal
Class ObjectServerImpl
- java.lang.Object
-
- com.db4o.cs.internal.ObjectServerImpl
-
- All Implemented Interfaces:
ObjectServerEvents,ExtObjectServer,ObjectServer,TransientClass,java.lang.Runnable
public class ObjectServerImpl extends java.lang.Object implements ObjectServerEvents, ObjectServer, ExtObjectServer, java.lang.Runnable, TransientClass
-
-
Constructor Summary
Constructors Constructor Description ObjectServerImpl(LocalObjectContainer container, ServerConfiguration serverConfig, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommittedInfoMsg(MCommittedInfo message)voidbackup(java.lang.String path)backs up the database file used by the ObjectServer.voidbroadcastMsg(Msg message, BroadcastFilter filter)voidbroadcastReplicationCommit(long timestamp, java.util.List concurrentTimestamps)booleancaresAboutCommitted()voidcheckCaresAboutCommitted()ClassInfoHelperclassInfoHelper()Event4<ClientConnectionEventArgs>clientConnected()intclientCount()returns the number of connected clients.Event4<StringEventArgs>clientDisconnected()booleanclose()Closes theObjectServerand writes all cached data.booleanclose(ShutdownMode mode)Event4<ServerClosedEventArgs>closed()Configurationconfigure()returns theConfigurationcontext for this ObjectServer.voiddispose()System.IDisposable.Dispose()ExtObjectServerext()Returns anExtObjectServerwith extended functionality.UsergetUser(java.lang.String userName)voidgrantAccess(java.lang.String userName, java.lang.String password)Grants client access to the specified user with the specified password.Iterator4iterateDispatchers()ObjectContainerobjectContainer()returns the ObjectContainer used by the server.ObjectContaineropenClient()Opens a client against this server.intport()voidrevokeAccess(java.lang.String userName)removes client access permissions for the specified user.voidrun()inttransactionCount()
-
-
-
Constructor Detail
-
ObjectServerImpl
public ObjectServerImpl(LocalObjectContainer container, ServerConfiguration serverConfig, int port)
-
-
Method Detail
-
backup
public void backup(java.lang.String path) throws java.io.IOExceptionDescription copied from interface:ExtObjectServerbacks up the database file used by the ObjectServer.
While the backup is running, the ObjectServer can continue to be used. Changes that are made while the backup is in progress, will be applied to the open ObjectServer and to the backup.
While the backup is running, the ObjectContainer should not be closed.
If a file already exists at the specified path, it will be overwritten.- Specified by:
backupin interfaceExtObjectServer- Parameters:
path- a fully qualified path- Throws:
java.io.IOException
-
dispose
public void dispose()
System.IDisposable.Dispose()
-
close
public boolean close()
Description copied from interface:ObjectServer- Specified by:
closein interfaceObjectServer- Returns:
- true - denotes that the last instance connected to the used database file was closed.
-
close
public boolean close(ShutdownMode mode)
-
iterateDispatchers
public Iterator4 iterateDispatchers()
-
configure
public Configuration configure()
Description copied from interface:ExtObjectServer- Specified by:
configurein interfaceExtObjectServer- Returns:
- the Configuration context for this ObjectServer
-
ext
public ExtObjectServer ext()
Description copied from interface:ObjectServerReturns anExtObjectServerwith extended functionality.
Use this method to conveniently access extended methods.
The functionality is split to two interfaces to allow newcomers to focus on the essential methods.- Specified by:
extin interfaceObjectServer
-
grantAccess
public void grantAccess(java.lang.String userName, java.lang.String password)Description copied from interface:ObjectServerGrants client access to the specified user with the specified password.
If the user already exists, the password is changed to the specified password.- Specified by:
grantAccessin interfaceObjectServer- Parameters:
userName- the name of the userpassword- the password to be used
-
getUser
public User getUser(java.lang.String userName)
-
objectContainer
public ObjectContainer objectContainer()
Description copied from interface:ExtObjectServerreturns the ObjectContainer used by the server.- Specified by:
objectContainerin interfaceExtObjectServer- Returns:
- the ObjectContainer used by the server
-
openClient
public ObjectContainer openClient()
Description copied from interface:ObjectServerOpens a client against this server.
A client opened with this method operates within the same VM as the server. Since an embedded client use direct communication, without an in-between socket connection, performance will be better than a client opened withDb4oClientServer#openClient(java.lang.String, int, java.lang.String, java.lang.String)
Every client has it's own transaction and uses it's own cache for it's own version of all persistent objects.- Specified by:
openClientin interfaceObjectServer
-
revokeAccess
public void revokeAccess(java.lang.String userName)
Description copied from interface:ExtObjectServerremoves client access permissions for the specified user.- Specified by:
revokeAccessin interfaceExtObjectServer- Parameters:
userName- the name of the user
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
addCommittedInfoMsg
public void addCommittedInfoMsg(MCommittedInfo message)
-
broadcastReplicationCommit
public void broadcastReplicationCommit(long timestamp, java.util.List concurrentTimestamps)
-
broadcastMsg
public void broadcastMsg(Msg message, BroadcastFilter filter)
-
caresAboutCommitted
public boolean caresAboutCommitted()
-
checkCaresAboutCommitted
public void checkCaresAboutCommitted()
-
port
public int port()
- Specified by:
portin interfaceExtObjectServer- Returns:
- The local port this server uses, 0 if disconnected or in embedded mode
-
clientCount
public int clientCount()
Description copied from interface:ExtObjectServerreturns the number of connected clients.- Specified by:
clientCountin interfaceExtObjectServer
-
classInfoHelper
public ClassInfoHelper classInfoHelper()
-
clientConnected
public Event4<ClientConnectionEventArgs> clientConnected()
- Specified by:
clientConnectedin interfaceObjectServerEvents
-
clientDisconnected
public Event4<StringEventArgs> clientDisconnected()
- Specified by:
clientDisconnectedin interfaceObjectServerEvents- Returns:
- an event that provides the name of the client being disconnected.
-
closed
public Event4<ServerClosedEventArgs> closed()
- Specified by:
closedin interfaceObjectServerEvents
-
transactionCount
public int transactionCount()
-
-