org.starhope.appius.via
Class RemoteRoom

java.lang.Object
  extended by org.starhope.appius.via.RemoteRoom
All Implemented Interfaces:
AbstractRoom, ViaMunita<AbstractRoom>

public class RemoteRoom
extends Object
implements AbstractRoom, ViaMunita<AbstractRoom>

WRITEME: The documentation for this type (RemoteRoom) is incomplete. (brpocock, Jan 11, 2010)

Author:
brpocock

Field Summary
private  String moniker
          WRITEME: document this field (brpocock, Jan 13, 2010) moniker (RemoteRoom)
private  int remotePort
          WRITEME
private  String remoteServer
          WRITEME
private  String remoteZone
          WRITEME
private  int roomID
          WRITEME: document this field (brpocock, Jan 13, 2010) roomID (RemoteRoom)
 
Constructor Summary
RemoteRoom(String url)
          WRITEME
 
Method Summary
 void add(GameEvent game)
          This is an overriding method.
 int compareTo(AbstractRoom other)
          This is an overriding method.
 boolean contains(AbstractUser user)
          This is an overriding method.
 void deleteVariable(String string)
          This is an overriding method.
 void destroySelf()
          This is an overriding method.
 boolean equals(AbstractRoom other)
          This is an overriding method.
 void flush()
          This is an overriding method.
 void fromJSON(org.json.JSONObject jso)
          This is an overriding method.
 Set<RoomListener> getAllListeners()
          This is an overriding method.
 Collection<AbstractUser> getAllUsers()
          This is an overriding method.
 String getDebugName()
          This is an overriding method.
 String getFilename()
          This is an overriding method.
 GameEvent getGameEvent()
          This is an overriding method.
 int getId()
          Deprecated. use getID()
 int getID()
          This is an overriding method.
 Collection<RoomListener> getListeners()
          This is an overriding method.
 int getMaxUsers()
          This is an overriding method.
 String getMoniker()
          This is an overriding method.
 String getMusic()
          This is an overriding method.
 String getName()
          This is an overriding method.
 String getOverlay()
          This is an overriding method.
 AbstractUser getOwner()
           
 int getRoomIndex()
           Get the index of this room within the set of rooms to which it belongs.
 String getSky()
          This is an overriding method.
 String getTitle()
          This is an overriding method.
 int getUserCount()
          This is an overriding method.
 String getVariable(String string)
          This is an overriding method.
 HashMap<String,String> getVariables()
          This is an overriding method.
 String getViaAppiaHostname()
          This is an overriding method.
 String getViaAppiaRemoteEndpointID()
          This is an overriding method.
 int getViaAppiaServerPort()
          This is an overriding method.
 Class<AbstractRoom> getViaPeerClass()
           
 AbstractZone getZone()
          This is an overriding method.
 boolean isLimbo()
          This is an overriding method.
 boolean isSkyVisible()
          This is an overriding method.
 void join(RoomListener who)
          This is an overriding method.
 void part(RoomListener thing)
          This is an overriding method.
 void sendGameAction(User from, org.json.JSONObject data)
          This is an overriding method.
 void sendPublicMessage(AbstractUser from, String speech)
          This is an overriding method.
 void setFilename(String filename1)
          This is an overriding method.
 void setLimbo(boolean b)
          This is an overriding method.
 void setMoniker(String moniker1)
          This is an overriding method.
 void setMusic(String music1)
          This is an overriding method.
 void setOverlay(String overlay1)
          This is an overriding method.
 void setOwner(AbstractUser newHomeOwner)
          This is an overriding method.
 void setRoomVars()
          This is an overriding method.
 void setSky(String sky1)
          This is an overriding method.
 void setSkyVisible(boolean skyVisible1)
          This is an overriding method.
 void setTitle(String newTitle)
          This is an overriding method.
 void setVariable(Map.Entry<String,String> var)
          This is an overriding method.
 void setVariable(String varName, String varValue)
          This is an overriding method.
 void setVariables(Map<String,String> map)
          This is an overriding method.
 org.json.JSONObject toJSON()
          This is an overriding method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.starhope.appius.game.AbstractRoom
hashCode
 

Field Detail

moniker

private final String moniker
WRITEME: document this field (brpocock, Jan 13, 2010) moniker (RemoteRoom)


remotePort

private final int remotePort
WRITEME


remoteServer

private final String remoteServer
WRITEME


remoteZone

private final String remoteZone
WRITEME


roomID

private final int roomID
WRITEME: document this field (brpocock, Jan 13, 2010) roomID (RemoteRoom)

Constructor Detail

RemoteRoom

public RemoteRoom(String url)
WRITEME

Parameters:
url - WRITEME
Method Detail

add

public void add(GameEvent game)
This is an overriding method.

Specified by:
add in interface AbstractRoom
Parameters:
game - WRITEME
See Also:
AbstractRoom.add(org.starhope.appius.game.GameEvent)

compareTo

public int compareTo(AbstractRoom other)
This is an overriding method.

Parameters:
other - another room to be compared against
Returns:
a slightly arbitrary sort order
See Also:
Comparable.compareTo(Object)

contains

public boolean contains(AbstractUser user)
This is an overriding method.

Specified by:
contains in interface AbstractRoom
Parameters:
user - who
Returns:
true if they are in this room
See Also:
AbstractRoom.contains(AbstractUser)

deleteVariable

public void deleteVariable(String string)
This is an overriding method.

Specified by:
deleteVariable in interface AbstractRoom
Parameters:
string - WRITEME
See Also:
AbstractRoom.deleteVariable(java.lang.String)

destroySelf

public void destroySelf()
This is an overriding method.

Specified by:
destroySelf in interface AbstractRoom
See Also:
AbstractRoom.destroySelf()

equals

public boolean equals(AbstractRoom other)
This is an overriding method.

Parameters:
other - WRITEME
Returns:
WRITEME
See Also:
Object.equals(Object)

flush

public void flush()
This is an overriding method.

Specified by:
flush in interface AbstractRoom
See Also:
AbstractRoom.flush()

fromJSON

public void fromJSON(org.json.JSONObject jso)
              throws org.json.JSONException
This is an overriding method.

Specified by:
fromJSON in interface AbstractRoom
Parameters:
jso - Serialized form
Throws:
org.json.JSONException - if the incoming data isn't in the right form
See Also:
AbstractRoom.fromJSON(org.json.JSONObject)

getAllListeners

public Set<RoomListener> getAllListeners()
This is an overriding method.

Specified by:
getAllListeners in interface AbstractRoom
Returns:
WRITEME
See Also:
AbstractRoom.getAllListeners()

getAllUsers

public Collection<AbstractUser> getAllUsers()
This is an overriding method.

Specified by:
getAllUsers in interface AbstractRoom
Returns:
WRITEME
See Also:
AbstractRoom.getAllUsers()

getDebugName

public String getDebugName()
This is an overriding method.

Specified by:
getDebugName in interface AbstractRoom
Returns:
A string uniquely identifying this room for debugging purposes.
See Also:
AbstractRoom.getDebugName()

getFilename

public String getFilename()
This is an overriding method.

Specified by:
getFilename in interface AbstractRoom
Returns:
the filename
See Also:
AbstractRoom.getFilename()

getGameEvent

public GameEvent getGameEvent()
This is an overriding method.

Specified by:
getGameEvent in interface AbstractRoom
Returns:
The Game Event in this room, or (usually) null
See Also:
AbstractRoom.getGameEvent()

getId

@Deprecated
public int getId()
Deprecated. use getID()

This is an overriding method.

Specified by:
getId in interface AbstractRoom
Returns:
the room's ID number
See Also:
AbstractRoom.getId()

getID

public int getID()
This is an overriding method.

Specified by:
getID in interface AbstractRoom
Returns:
the room's ID number
See Also:
AbstractRoom.getID()

getListeners

public Collection<RoomListener> getListeners()
This is an overriding method.

Specified by:
getListeners in interface AbstractRoom
Returns:
all RoomListeners, including all users and observers
See Also:
AbstractRoom.getListeners()

getMaxUsers

public int getMaxUsers()
This is an overriding method.

Specified by:
getMaxUsers in interface AbstractRoom
Returns:
WRITEME
See Also:
AbstractRoom.getMaxUsers()

getMoniker

public String getMoniker()
This is an overriding method.

Specified by:
getMoniker in interface AbstractRoom
Returns:
the moniker
See Also:
AbstractRoom.getMoniker()

getMusic

public String getMusic()
This is an overriding method.

Specified by:
getMusic in interface AbstractRoom
Returns:
WRITEME
See Also:
AbstractRoom.getMusic()

getName

public String getName()
This is an overriding method.

Specified by:
getName in interface AbstractRoom
Returns:
WRITEME
See Also:
AbstractRoom.getName()

getOverlay

public String getOverlay()
This is an overriding method.

Specified by:
getOverlay in interface AbstractRoom
Returns:
the overlay
See Also:
AbstractRoom.getOverlay()

getOwner

public AbstractUser getOwner()
Specified by:
getOwner in interface AbstractRoom
Returns:
the owner of this room, if this is a private (user-created) room; else, null.
See Also:
AbstractRoom.getOwner()

getRoomIndex

public int getRoomIndex()
Description copied from interface: AbstractRoom

Get the index of this room within the set of rooms to which it belongs.

For user-created rooms, this is the index of the room number within the user's “house,” typically 0 for the first room, 1 for the yard, and 2 or more for additional rooms.

The meaning of this index varies depending upon context; presently, it is only meaningful for user houses.

Specified by:
getRoomIndex in interface AbstractRoom
Returns:
the index of this room
See Also:
AbstractRoom.getRoomIndex()

getSky

public String getSky()
This is an overriding method.

Specified by:
getSky in interface AbstractRoom
Returns:
the file to load for the sky of this room
See Also:
AbstractRoom.getSky()

getTitle

public String getTitle()
This is an overriding method.

Specified by:
getTitle in interface AbstractRoom
Returns:
the user-visible title of the room
See Also:
AbstractRoom.getTitle()

getUserCount

public int getUserCount()
This is an overriding method.

Specified by:
getUserCount in interface AbstractRoom
Returns:
the number of users in the room
See Also:
AbstractRoom.getUserCount()

getVariable

public String getVariable(String string)
This is an overriding method.

Specified by:
getVariable in interface AbstractRoom
Parameters:
string - the variable name for which the value is requested
Returns:
the value of that variable, if any, or null, if no such variable is attached to this room
See Also:
AbstractRoom.getVariable(java.lang.String)

getVariables

public HashMap<String,String> getVariables()
This is an overriding method.

Specified by:
getVariables in interface AbstractRoom
Returns:
room variables
See Also:
AbstractRoom.getVariables()

getViaAppiaHostname

public String getViaAppiaHostname()
This is an overriding method.

Specified by:
getViaAppiaHostname in interface ViaMunita<AbstractRoom>
Returns:
The hostname of the Via Appia peer (Appius server) on which the remote object is actually located
See Also:
ViaMunita.getViaAppiaHostname()

getViaAppiaRemoteEndpointID

public String getViaAppiaRemoteEndpointID()
This is an overriding method.

Specified by:
getViaAppiaRemoteEndpointID in interface ViaMunita<AbstractRoom>
Returns:
The object endpoint code of the Via Appia peer (Appius server) on which the remote object is actually located
See Also:
ViaMunita.getViaAppiaRemoteEndpointID()

getViaAppiaServerPort

public int getViaAppiaServerPort()
This is an overriding method.

Specified by:
getViaAppiaServerPort in interface ViaMunita<AbstractRoom>
Returns:
The port number of the Via Appia peer (Appius server) on which the remote object is actually located
See Also:
ViaMunita.getViaAppiaServerPort()

getViaPeerClass

public Class<AbstractRoom> getViaPeerClass()
Specified by:
getViaPeerClass in interface ViaMunita<AbstractRoom>
Returns:
the class of the ViaAppia peer. This is a hack to obtain the generic type equivalences stuff for the implementers, and can probably be factored out if I get smarter about reflection and generics.
See Also:
ViaMunita.getViaPeerClass()

getZone

public AbstractZone getZone()
This is an overriding method.

Specified by:
getZone in interface AbstractRoom
Returns:
The zone in which this Room is found
See Also:
AbstractRoom.getZone()

isLimbo

public boolean isLimbo()
This is an overriding method.

Specified by:
isLimbo in interface AbstractRoom
Returns:
true, if this is a limbo room
See Also:
AbstractRoom.isLimbo()

isSkyVisible

public boolean isSkyVisible()
This is an overriding method.

Specified by:
isSkyVisible in interface AbstractRoom
Returns:
true, if the sky is visible in this room; else, false
See Also:
AbstractRoom.isSkyVisible()

join

public void join(RoomListener who)
This is an overriding method.

Specified by:
join in interface AbstractRoom
Parameters:
who - the thing that has joined the room
See Also:
AbstractRoom.join(RoomListener)

part

public void part(RoomListener thing)
This is an overriding method.

Specified by:
part in interface AbstractRoom
Parameters:
thing - the thing which wants to stop listening to the room
See Also:
AbstractRoom.part(RoomListener)

sendGameAction

public void sendGameAction(User from,
                           org.json.JSONObject data)
                    throws org.json.JSONException
This is an overriding method.

Specified by:
sendGameAction in interface AbstractRoom
Parameters:
from - WRITEME
data - WRITEME
Throws:
org.json.JSONException - if the action can't be represented in JSON
See Also:
AbstractRoom.sendGameAction(org.starhope.appius.user.User, org.json.JSONObject)

sendPublicMessage

public void sendPublicMessage(AbstractUser from,
                              String speech)
This is an overriding method.

Specified by:
sendPublicMessage in interface AbstractRoom
Parameters:
from - WRITEME
speech - WRITEME
See Also:
AbstractRoom.sendPublicMessage(org.starhope.appius.user.AbstractUser, java.lang.String)

setFilename

public void setFilename(String filename1)
This is an overriding method.

Specified by:
setFilename in interface AbstractRoom
Parameters:
filename1 - the filename to set
See Also:
AbstractRoom.setFilename(java.lang.String)

setLimbo

public void setLimbo(boolean b)
This is an overriding method.

Specified by:
setLimbo in interface AbstractRoom
Parameters:
b - true, if this is a limbo room
See Also:
AbstractRoom.setLimbo(boolean)

setMoniker

public void setMoniker(String moniker1)
This is an overriding method.

Specified by:
setMoniker in interface AbstractRoom
Parameters:
moniker1 - the moniker to set
See Also:
AbstractRoom.setMoniker(java.lang.String)

setMusic

public void setMusic(String music1)
This is an overriding method.

Specified by:
setMusic in interface AbstractRoom
Parameters:
music1 - the new background music
See Also:
AbstractRoom.setMusic(java.lang.String)

setOverlay

public void setOverlay(String overlay1)
This is an overriding method.

Specified by:
setOverlay in interface AbstractRoom
Parameters:
overlay1 - the overlay to set
See Also:
AbstractRoom.setOverlay(java.lang.String)

setOwner

public void setOwner(AbstractUser newHomeOwner)
This is an overriding method.

Specified by:
setOwner in interface AbstractRoom
Parameters:
newHomeOwner - new home owner
See Also:
AbstractRoom.setOwner(org.starhope.appius.user.AbstractUser)

setRoomVars

public void setRoomVars()
This is an overriding method.

Specified by:
setRoomVars in interface AbstractRoom
See Also:
AbstractRoom.setRoomVars()

setSky

public void setSky(String sky1)
This is an overriding method.

Specified by:
setSky in interface AbstractRoom
Parameters:
sky1 - the sky to set
See Also:
AbstractRoom.setSky(java.lang.String)

setSkyVisible

public void setSkyVisible(boolean skyVisible1)
This is an overriding method.

Specified by:
setSkyVisible in interface AbstractRoom
Parameters:
skyVisible1 - the skyVisible to set
See Also:
AbstractRoom.setSkyVisible(boolean)

setTitle

public void setTitle(String newTitle)
This is an overriding method.

Specified by:
setTitle in interface AbstractRoom
Parameters:
newTitle - WRITEME
See Also:
AbstractRoom.setTitle(java.lang.String)

setVariable

public void setVariable(Map.Entry<String,String> var)
This is an overriding method.

Specified by:
setVariable in interface AbstractRoom
Parameters:
var - A Hash type Entry object containing a key-value pair to be used to set a variable.
See Also:
AbstractRoom.setVariable(java.util.Map.Entry)

setVariable

public void setVariable(String varName,
                        String varValue)
This is an overriding method.

Specified by:
setVariable in interface AbstractRoom
Parameters:
varName - the name of the room variable to alter
varValue - the new value
See Also:
AbstractRoom.setVariable(java.lang.String, java.lang.String)

setVariables

public void setVariables(Map<String,String> map)
This is an overriding method.

Specified by:
setVariables in interface AbstractRoom
Parameters:
map - a map containing variables and
See Also:
AbstractRoom.setVariables(java.util.Map)

toJSON

public org.json.JSONObject toJSON()
This is an overriding method.

Specified by:
toJSON in interface AbstractRoom
Returns:
the room's JSON representation
See Also:
AbstractRoom.toJSON()