Package com.db4o
Interface ObjectServer
-
- All Known Subinterfaces:
ExtObjectServer
- All Known Implementing Classes:
ObjectServerImpl
public interface ObjectServer
The db4o server interface.
- db4o servers can be opened withDb4oClientServer#openServer(String, int)
.
- Direct in-memory connections to servers can be made withopenClient()
- TCP connections are available throughDb4oClientServer#openClient(String, int, String, String)
.
Before connecting clients over TCP, you have tograntAccess(String, String)
to the username and password combination that you want to use.- See Also:
Db4o.openServer
,ExtObjectServer for extended functionality
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
close()
Closes theObjectServer
and writes all cached data.ExtObjectServer
ext()
Returns anExtObjectServer
with extended functionality.void
grantAccess(java.lang.String userName, java.lang.String password)
Grants client access to the specified user with the specified password.ObjectContainer
openClient()
Opens a client against this server.
-
-
-
Method Detail
-
close
boolean close()
- Returns:
- true - denotes that the last instance connected to the used database file was closed.
-
ext
ExtObjectServer ext()
Returns anExtObjectServer
with 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.
-
grantAccess
void grantAccess(java.lang.String userName, java.lang.String password)
Grants client access to the specified user with the specified password.
If the user already exists, the password is changed to the specified password.- Parameters:
userName
- the name of the userpassword
- the password to be used
-
openClient
ObjectContainer openClient()
Opens 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.
-
-