jpl.mipl.mdms.web.domain
Class ChannelListener

java.lang.Object
  extended by jpl.mipl.mdms.web.domain.ChannelListener
All Implemented Interfaces:
MessageListener

public class ChannelListener
extends Object
implements MessageListener

Purpose: Channel listener that listens specifically for server metric information and passes that information to the domain model

   Copyright 2006, California Institute of Technology.
   ALL RIGHTS RESERVED.
   U.S. Government Sponsorship acknowledge. 2006.
   
 ============================================================================
 Modification History :
 ----------------------

 Date              Who              What
 ----------------------------------------------------------------------------
 08/11/2006        Nick             Initial Release
 ============================================================================
 

Version:
$Id: ChannelListener.java,v 1.4 2009/07/23 18:18:34 ntt Exp $
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Constructor Summary
ChannelListener(DomainModel domainModel)
          Constructor
 
Method Summary
protected  boolean isConnectionOpcode(AgentOpcode opcode)
          Examines opcode to determine if associated message is connection related
protected  void processMessage(String msg)
          Processes string messages received from the channel
 void receive(Serializable msg)
          This method gets called when a message is braodcasted on the Channel.
 void viewAccepted(String view)
          Empty implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelListener

public ChannelListener(DomainModel domainModel)
Constructor

Parameters:
domainModel - Instance of domain model that will be updated with new metrics retrieved from incoming messages
Method Detail

receive

public void receive(Serializable msg)
This method gets called when a message is braodcasted on the Channel. Currently, this method only recognizes a String msg.

Specified by:
receive in interface MessageListener
Parameters:
msg - the message placed on the channel
See Also:
MessageListener.receive(java.io.Serializable)

processMessage

protected void processMessage(String msg)
Processes string messages received from the channel

Parameters:
msg - String representation of message

isConnectionOpcode

protected boolean isConnectionOpcode(AgentOpcode opcode)
Examines opcode to determine if associated message is connection related

Parameters:
opcode - Agent Opcode
Returns:
True if connection opcode, false otherwise

viewAccepted

public void viewAccepted(String view)
Empty implementation

Specified by:
viewAccepted in interface MessageListener
Parameters:
view - the string representation of the view.