Module is.codion.common.rmi
Package is.codion.common.rmi.server
Interface Server<C extends Remote,A extends ServerAdmin>
- Type Parameters:
C
- the type of remote interface this server supplies to clientsA
- the type of the admin interface this server supplies
- All Superinterfaces:
Remote
- All Known Implementing Classes:
AbstractServer
,EntityServer
A server for serving remote interfaces
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Specifies the client host connection parameter -
Method Summary
Modifier and TypeMethodDescriptionconnect
(ConnectionRequest connectionRequest) Establishes a connection to this Serverboolean
void
disconnect
(UUID clientId) Disconnects the connection identified by the given key.serverAdmin
(User user) Returns the admin interface used to administer this serverint
-
Field Details
-
CLIENT_HOST
Specifies the client host connection parameter- See Also:
-
-
Method Details
-
connect
C connect(ConnectionRequest connectionRequest) throws RemoteException, ConnectionNotAvailableException, LoginException Establishes a connection to this Server- Parameters:
connectionRequest
- the information required for establishing a connection- Returns:
- a remote connection instance
- Throws:
RemoteException
- in case of a communication errorConnectionNotAvailableException
- in case the server isn't accepting more connectionsLoginException
- in case the login fails
-
serverAdmin
Returns the admin interface used to administer this server- Parameters:
user
- the admin user credentials- Returns:
- the admin interface
- Throws:
RemoteException
- in case of a communication errorServerAuthenticationException
- in case authentication fails
-
disconnect
Disconnects the connection identified by the given key.- Parameters:
clientId
- the UUID identifying the client that should be disconnected- Throws:
RemoteException
- in case of a communication error
-
serverInformation
- Returns:
- static information about this server
- Throws:
RemoteException
- in case of an exception
-
serverLoad
- Returns:
- the server load as number of service requests per second
- Throws:
RemoteException
- in case of an exception
-
connectionsAvailable
- Returns:
- true if there are connections available
- Throws:
RemoteException
- in case of an exception
-