org.jdesktop.wonderland.common.cell.messages
Class CellServerComponentMessage

java.lang.Object
  extended by org.jdesktop.wonderland.common.messages.Message
      extended by org.jdesktop.wonderland.common.cell.messages.CellMessage
          extended by org.jdesktop.wonderland.common.cell.messages.CellServerComponentMessage
All Implemented Interfaces:
java.io.Serializable

public class CellServerComponentMessage
extends CellMessage

A message class to either add or remove a component to/from the cell, given either the components server-side state or the server-side cell component class name.

This message can be used under two circumstances: to instruction the server to add/remove a component to/from cell, or as an event message sent back to the client who are listening for changes to the components on the server cell.

Author:
Jordan Slott
See Also:
Serialized Form

Nested Class Summary
static class CellServerComponentMessage.ComponentAction
           
 
Constructor Summary
CellServerComponentMessage(CellID cellID, CellComponentServerState serverState)
          Constructor that takes the server state (used to add a component)
CellServerComponentMessage(CellID cellID, java.lang.String className)
          Constructor that takes the server-side component class name and leaves the server state null.
 
Method Summary
 java.lang.String getCellComponentServerClassName()
          Returns the comonent's server-side class name, this can never be null.
 CellComponentServerState getCellComponentServerState()
          Returns the component's server state, or null if not set.
 CellServerComponentMessage.ComponentAction getComponentAction()
          Returns the type of component action, either ADD or REMOVE
static CellServerComponentMessage newAddMessage(CellID cellID, CellComponentServerState serverState)
          Creates a new ADD component message given the cell id and cell component server state object.
static CellServerComponentMessage newAddMessage(CellID cellID, java.lang.String className)
          Creates a new ADD component message given the cell id and the cell component server-side class name.
static CellServerComponentMessage newRemoveMessage(CellID cellID, java.lang.String className)
          Creates a new REMOVE component message given the cell id and cell component server-side class name.
 
Methods inherited from class org.jdesktop.wonderland.common.cell.messages.CellMessage
getCellID, getSenderID, setCellID, setSenderID
 
Methods inherited from class org.jdesktop.wonderland.common.messages.Message
getMessageID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellServerComponentMessage

public CellServerComponentMessage(CellID cellID,
                                  CellComponentServerState serverState)
Constructor that takes the server state (used to add a component)

Parameters:
cellID - The unique ID of the cell
serverState - The cell component server state

CellServerComponentMessage

public CellServerComponentMessage(CellID cellID,
                                  java.lang.String className)
Constructor that takes the server-side component class name and leaves the server state null. (used to remove a component)

Parameters:
cellID - The unique ID of the cell
className - The class name of the server-side component
Method Detail

getComponentAction

public CellServerComponentMessage.ComponentAction getComponentAction()
Returns the type of component action, either ADD or REMOVE

Returns:
Either ADD or REMOVE

getCellComponentServerState

public CellComponentServerState getCellComponentServerState()
Returns the component's server state, or null if not set.

Returns:
The cell component server state, possibly null

getCellComponentServerClassName

public java.lang.String getCellComponentServerClassName()
Returns the comonent's server-side class name, this can never be null.

Returns:
The cell component server class name

newAddMessage

public static CellServerComponentMessage newAddMessage(CellID cellID,
                                                       CellComponentServerState serverState)
Creates a new ADD component message given the cell id and cell component server state object.

Parameters:
cellID - The unique ID of the cell
serverState - The cell component server state
Returns:
A new CellServerComponentMessage class

newAddMessage

public static CellServerComponentMessage newAddMessage(CellID cellID,
                                                       java.lang.String className)
Creates a new ADD component message given the cell id and the cell component server-side class name.

Parameters:
cellID - The unique ID of the cell
className - The cell component server class name
Returns:
A new CellServerComponentMessage class

newRemoveMessage

public static CellServerComponentMessage newRemoveMessage(CellID cellID,
                                                          java.lang.String className)
Creates a new REMOVE component message given the cell id and cell component server-side class name.

Parameters:
cellID - The unique ID of the cell
className - The cell component server class name
Returns:
A new CellServerComponentMessage class


Open Wonderland - http://openwonderland.org