|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.agh.iosr.ballamigos.webapp.core.WebApplicationCommunicator
public class WebApplicationCommunicator
| Constructor Summary | |
|---|---|
WebApplicationCommunicator(java.util.Properties props)
|
|
WebApplicationCommunicator(java.lang.String serverName,
int port)
Constructor that tries to locate server via rmiregistry |
|
| Method Summary | |
|---|---|
void |
changeMatchProperties(pl.agh.iosr.ballamigos.common.MatchProperties properties)
Change properties of current match |
void |
createMatch(java.lang.String name)
tries to create and register a match on the server |
void |
createPlayer(java.lang.String login,
java.lang.String passwd)
|
pl.agh.iosr.ballamigos.common.Match |
getMatch()
|
pl.agh.iosr.ballamigos.client.room.MatchesListModel |
getMatches()
|
java.util.List<java.lang.String> |
getMatchesInRoom()
Gets a list of matches for the chosen room. |
java.lang.String |
getPlayerLogin()
|
java.util.List<java.lang.String> |
getPlayersInRoom()
requests list of players names in player room from server. |
java.lang.String |
getRoomName()
|
java.util.List<java.lang.String> |
getRoomNames()
|
pl.agh.iosr.ballamigos.common.communication.rmi.ServerInterface |
getServer()
|
pl.agh.iosr.ballamigos.common.ServerStatistics |
getServerStatistics()
|
void |
joinMatch(java.lang.String matchName)
Joins match if posible. |
void |
login(java.lang.String login,
java.lang.String passwd)
tries to log to a server using login and password |
void |
logout()
logs this player out of server. |
void |
matchCreated(java.lang.String matchName)
Notyfies that a macth in this room was created. |
boolean |
matchReceived()
|
void |
matchRemoved(java.lang.String matchName)
Notyfies that a macth in this room was removed. |
boolean |
matchStarted()
Check if current match is active |
void |
moveToRoom(java.lang.String roomName)
tells server to bind player to a room |
boolean |
playerEntered()
|
void |
playerEnteredRoom(java.lang.String playerName)
Used to notify client that a player has entered the room he is in. |
void |
playerJoins(java.lang.String playerName)
Implements playerJoins method. |
void |
playerLeftRoom(java.lang.String playerName)
Used to notify client that a player has left the room he is in. |
void |
playerQuitedMatch()
|
void |
reciveCurrentMatch(pl.agh.iosr.ballamigos.common.Match match)
Implements reciveCurrentMatch method. |
void |
reciveMessage(java.lang.String arg0)
|
void |
reciveMessage(java.lang.String arg0,
java.lang.String arg1)
|
void |
reciveMessage(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
|
void |
sendDecision(pl.agh.iosr.ballamigos.common.Decision decision)
Sends current player move decision. |
void |
sendStartMatch()
Sends a signal to server to start match, if succed start the match on this clienmt to. |
void |
setMatch(pl.agh.iosr.ballamigos.common.Match match)
|
void |
setMatches(pl.agh.iosr.ballamigos.client.room.MatchesListModel matches)
|
void |
setPlayerLogin(java.lang.String playerLogin)
|
void |
setRoomName(java.lang.String roomName)
|
void |
setRoomNames(java.util.List<java.lang.String> roomNames)
|
void |
setServer(pl.agh.iosr.ballamigos.common.communication.rmi.ServerInterface server)
|
void |
startMatch()
Implements startMatch method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebApplicationCommunicator(java.lang.String serverName,
int port)
throws java.rmi.RemoteException,
java.rmi.NotBoundException
serverName - - inet addres of rmiregistryport - - port of rmiregistry
java.rmi.RemoteException - - can't connect to rmiregistry
java.rmi.NotBoundException - - there's no server bounded in rmiregistry
public WebApplicationCommunicator(java.util.Properties props)
throws java.lang.NumberFormatException,
java.rmi.RemoteException,
java.rmi.NotBoundException
java.lang.NumberFormatException
java.rmi.RemoteException
java.rmi.NotBoundException| Method Detail |
|---|
public void login(java.lang.String login,
java.lang.String passwd)
throws java.rmi.RemoteException,
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyLoggedException,
pl.agh.iosr.ballamigos.common.exceptions.LoginException
login - - player login.passwd - - player password.
java.rmi.RemoteException - - server connection failed
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyLoggedException - - there is a player logged with this login.
pl.agh.iosr.ballamigos.common.exceptions.LoginException
public void createPlayer(java.lang.String login,
java.lang.String passwd)
throws java.rmi.RemoteException,
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyExistsException
login - passwd -
java.rmi.RemoteException
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyExistsException
public void moveToRoom(java.lang.String roomName)
throws java.rmi.RemoteException
roomName - - name of the room that player wants to join
java.rmi.RemoteException - - server connection failed
public java.util.List<java.lang.String> getPlayersInRoom()
throws java.rmi.RemoteException
java.rmi.RemoteException - - server connection failed
public void reciveMessage(java.lang.String arg0)
throws java.rmi.RemoteException
reciveMessage in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacejava.rmi.RemoteException
public void reciveMessage(java.lang.String arg0,
java.lang.String arg1)
throws java.rmi.RemoteException
reciveMessage in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacejava.rmi.RemoteException
public void reciveMessage(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
throws java.rmi.RemoteException
reciveMessage in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacejava.rmi.RemoteException
public void playerEnteredRoom(java.lang.String playerName)
throws java.rmi.RemoteException
playerEnteredRoom in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfaceplayerName - - name of player that entered room
java.rmi.RemoteExceptionClientInterface.playerEnteredRoom(java.lang.String)public void playerLeftRoom(java.lang.String playerName)
playerLeftRoom in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfaceplayerName - - name of player that left roomClientInterface.playerLeftRoom(java.lang.String)
public void logout()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void createMatch(java.lang.String name)
throws java.rmi.RemoteException,
pl.agh.iosr.ballamigos.common.exceptions.MatchAlreadyExistsException,
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyInGameException
name - - name of this match
java.rmi.RemoteException
pl.agh.iosr.ballamigos.common.exceptions.MatchAlreadyExistsException
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyInGameException
public void matchCreated(java.lang.String matchName)
throws java.rmi.RemoteException
matchCreated in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacematchName - - name match that was created.
java.rmi.RemoteExceptionClientInterface.matchCreated(java.lang.String)
public void matchRemoved(java.lang.String matchName)
throws java.rmi.RemoteException
matchRemoved in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacematchName - - name match that was removed.
java.rmi.RemoteExceptionClientInterface.matchRemoved(java.lang.String)
public void joinMatch(java.lang.String matchName)
throws java.rmi.RemoteException,
pl.agh.iosr.ballamigos.common.exceptions.MatchFullException,
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyInGameException
matchName - - name of a match to join
java.rmi.RemoteException
pl.agh.iosr.ballamigos.common.exceptions.MatchFullException
pl.agh.iosr.ballamigos.common.exceptions.PlayerAlreadyInGameException
public void playerJoins(java.lang.String playerName)
throws java.rmi.RemoteException
playerJoins in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacejava.rmi.RemoteExceptionClientInterface.playerJoins(java.lang.String)public void playerQuitedMatch()
playerQuitedMatch in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacepublic boolean matchReceived()
public void reciveCurrentMatch(pl.agh.iosr.ballamigos.common.Match match)
throws java.rmi.RemoteException
reciveCurrentMatch in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacejava.rmi.RemoteExceptionClientInterface.reciveCurrentMatch(pl.agh.iosr.ballamigos.common.Match)public boolean playerEntered()
public boolean matchStarted()
public void startMatch()
throws java.rmi.RemoteException
startMatch in interface pl.agh.iosr.ballamigos.common.communication.rmi.ClientInterfacejava.rmi.RemoteExceptionClientInterface.startMatch()
public void sendStartMatch()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void changeMatchProperties(pl.agh.iosr.ballamigos.common.MatchProperties properties)
throws java.rmi.RemoteException,
pl.agh.iosr.ballamigos.common.exceptions.MatchDoesntExistException
properties -
java.rmi.RemoteException
pl.agh.iosr.ballamigos.common.exceptions.MatchDoesntExistException
public void sendDecision(pl.agh.iosr.ballamigos.common.Decision decision)
throws java.rmi.RemoteException
decision - - contains player choises for this round.
java.rmi.RemoteException
public java.util.List<java.lang.String> getRoomNames()
throws java.rmi.RemoteException
java.rmi.RemoteException
public pl.agh.iosr.ballamigos.common.ServerStatistics getServerStatistics()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic pl.agh.iosr.ballamigos.common.Match getMatch()
public void setMatch(pl.agh.iosr.ballamigos.common.Match match)
match - The match to set.public pl.agh.iosr.ballamigos.client.room.MatchesListModel getMatches()
public void setMatches(pl.agh.iosr.ballamigos.client.room.MatchesListModel matches)
matches - The matches to set.public java.lang.String getPlayerLogin()
public void setPlayerLogin(java.lang.String playerLogin)
playerLogin - The playerLogin to set.public java.lang.String getRoomName()
public void setRoomName(java.lang.String roomName)
roomName - The roomName to set.public pl.agh.iosr.ballamigos.common.communication.rmi.ServerInterface getServer()
public void setServer(pl.agh.iosr.ballamigos.common.communication.rmi.ServerInterface server)
server - The server to set.public void setRoomNames(java.util.List<java.lang.String> roomNames)
roomNames - The roomNames to set.
public java.util.List<java.lang.String> getMatchesInRoom()
throws java.rmi.RemoteException
java.rmi.RemoteException - when there a problems with RMI
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||