org.jminor.common.server
Interface RemoteServer<T extends Remote>

Type Parameters:
T - the type of remote interface this server supplies to clients
All Superinterfaces:
Remote
All Known Implementing Classes:
AbstractRemoteServer, RemoteLoadTestServer

public interface RemoteServer<T extends Remote>
extends Remote

Defines the methods available to remote clients.


Field Summary
static String SERVER_ADMIN_PREFIX
           
 
Method Summary
 T connect(ClientInfo clientInfo)
          Establishes a connection to this RemoteServer
 T connect(User user, UUID clientID, String clientTypeID)
          Establishes a connection to this RemoteServer
 boolean connectionsAvailable()
           
 void disconnect(UUID clientID)
          Disconnects the connection identified by the given key.
 int getServerLoad()
           
 String getServerName()
           
 int getServerPort()
           
 

Field Detail

SERVER_ADMIN_PREFIX

static final String SERVER_ADMIN_PREFIX
See Also:
Constant Field Values
Method Detail

connect

T connect(ClientInfo clientInfo)
                         throws RemoteException,
                                ServerException.ServerFullException,
                                ServerException.LoginException
Establishes a connection to this RemoteServer

Parameters:
clientInfo - the client info
Returns:
a remote connection instance
Throws:
RemoteException - in case of a RemoteException
ServerException.ServerFullException - in case the server isn't accepting more connections
ServerException.LoginException - in case the login fails

connect

T connect(User user,
          UUID clientID,
          String clientTypeID)
                         throws RemoteException,
                                ServerException.ServerFullException,
                                ServerException.LoginException
Establishes a connection to this RemoteServer

Parameters:
user - the user
clientID - a UUID identifying the client
clientTypeID - a String identifying the client
Returns:
a remote connection instance
Throws:
RemoteException - in case of a RemoteException
ServerException.ServerFullException - in case the server isn't accepting more connections
ServerException.LoginException - in case the login fails

disconnect

void disconnect(UUID clientID)
                throws RemoteException
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

getServerName

String getServerName()
                     throws RemoteException
Returns:
the server name
Throws:
RemoteException - in case of a communication error

getServerPort

int getServerPort()
                  throws RemoteException
Returns:
the server port
Throws:
RemoteException - in case of a RemoteException

getServerLoad

int getServerLoad()
                  throws RemoteException
Returns:
the server load as number of service requests per second
Throws:
RemoteException - in case of an exception

connectionsAvailable

boolean connectionsAvailable()
                             throws RemoteException
Returns:
true if there are connections available
Throws:
RemoteException - in case of an exception