|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
net.bluebones.boggle.Client
public class Client
Controls the network side of the application from the client side.
| Field Summary |
|---|
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Constructor Summary | |
|---|---|
Client(Player player,
String name)
Initialises a Client. |
|
| Method Summary | |
|---|---|
String |
getAddr()
Gets the RMI address of this Client. |
String |
getName()
Gets the name of this client. |
boolean |
isActive(GameId gameId)
Determines if this Client is actively connected to the specified game. |
static void |
main(String[] args)
Simple commandline test of Client. |
void |
problem(String msg)
Displays an error message on this Client. |
void |
results(Round round,
Rubber rubber)
Notifies the client to process the results of a previous round. |
void |
setRubber(Rubber r)
Sets the rubber information for this client. |
void |
startGame(char[][] letters,
int timeInSecs,
GameId gameId)
Notifies the client to start a game with the specified letters. |
String |
toString()
Gets a String representation of this Client. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toStub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Client(Player player,
String name)
throws RemoteException,
UnknownHostException
RemoteException - If anything goes wrong with the RMI.
UnknownHostException - If client is unable to determine its
own address.| Method Detail |
|---|
public void startGame(char[][] letters,
int timeInSecs,
GameId gameId)
throws RemoteException
startGame in interface IClientletters - Letters to initialise the board with.timeInSecs - Time of game in seconds.gameId - Universally unique identifier for this game.
RemoteException - If anything goes wrong with the RMI.
public void results(Round round,
Rubber rubber)
throws RemoteException
results in interface IClientround - Results to process.rubber - Details of the rubber.
RemoteException - If anything goes wrong with the RMI.
public boolean isActive(GameId gameId)
throws RemoteException
isActive in interface IClientgameId - GameID of game to check for
participation in.
true if playing the game
represented by gameId.
RemoteException - If anything goes wrong with the RMI.
public void setRubber(Rubber r)
throws RemoteException
setRubber in interface IClientr - Rubber to set.
RemoteException - If anything goes wrong with the RMI.public String getAddr()
public void problem(String msg)
msg - Message to show.public String getName()
public static void main(String[] args)
throws UnknownHostException,
NotBoundException,
RemoteException,
MalformedURLException
args - Commandline arguments.
UnknownHostException - If local IP cannot be detected.
NotBoundException - If server cannot be found.
RemoteException - If anything goes wrong with the RMI.
MalformedURLException - If RMI address is malformed.public String toString()
String representation of this Client.
toString in class RemoteObjectString representation.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||