org.mbari.siam.core
Class SensorsJMSPublisher

java.lang.Object
  extended by org.mbari.siam.core.SensorsJMSPublisher
All Implemented Interfaces:
java.util.EventListener, ServiceListener

public class SensorsJMSPublisher
extends java.lang.Object
implements ServiceListener

SensorsJMSPacketPublisher is the interface from SIAM to the SENSORS project's prototype for CyberInfrastructure. This prototype is part of the NSF funded SNMP project - Scripps-NCSA-MBARI Prototype.

This class instantiates one InstrumentProxy for each SIAM device ID that it finds. The InstrumentProxy is in jar file instrument-proxy.jar, which is generated from the sources found in CVS under sensors/sensors-jms.

Author:
Bob Herlien

Nested Class Summary
protected  class SensorsJMSPublisher.ProxyContainer
          Class to store InstrumentProxy, indexed by ISI ID
 
Field Summary
protected static java.text.SimpleDateFormat _dateFormatter
           
protected  NodeService _node
           
protected  java.util.Vector _proxys
           
protected  boolean _publish
           
protected  java.lang.String MESSAGE_VARIABLE_NAME
           
protected  java.lang.String METADATA_VARIABLE_NAME
           
protected  java.lang.String NULL_UUID
           
protected  java.lang.String SENSOR_VARIABLE_NAME
           
protected  java.lang.String SUMMARY_VARIABLE_NAME
           
protected  byte[] UUID_KEY
           
 
Constructor Summary
SensorsJMSPublisher()
          Default SensorsJMSPublisher doesn't publish
SensorsJMSPublisher(boolean publish)
          Create a SensorsJMSPublisher
 
Method Summary
protected  org.mbari.instrument.InstrumentProxy getProxy(long isiId)
          Find or create an InstrumentProxy for this ISI ID
protected  java.lang.String getUUID(long isiId)
          Find the ISI ID for a given device (ISI) ID
 void printPacket(DevicePacket pkt)
          Print the pkt to System.out
 void publishData(DevicePacket pkt)
          Publish packet to JMS server.
 void serviceInstalled(ServiceEvent event)
          Action performed when service installed
 void serviceRemoved(ServiceEvent e)
          Action performed when service removed
 void serviceRequestComplete(ServiceEvent e)
          Action performed when service request complete
 void serviceSampleLogged(LogSampleServiceEvent event)
          Called whenever an InstrumentService logs a sample
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UUID_KEY

protected final byte[] UUID_KEY

SENSOR_VARIABLE_NAME

protected final java.lang.String SENSOR_VARIABLE_NAME
See Also:
Constant Field Values

METADATA_VARIABLE_NAME

protected final java.lang.String METADATA_VARIABLE_NAME
See Also:
Constant Field Values

MESSAGE_VARIABLE_NAME

protected final java.lang.String MESSAGE_VARIABLE_NAME
See Also:
Constant Field Values

SUMMARY_VARIABLE_NAME

protected final java.lang.String SUMMARY_VARIABLE_NAME
See Also:
Constant Field Values

NULL_UUID

protected final java.lang.String NULL_UUID
See Also:
Constant Field Values

_dateFormatter

protected static java.text.SimpleDateFormat _dateFormatter

_proxys

protected java.util.Vector _proxys

_publish

protected boolean _publish

_node

protected NodeService _node
Constructor Detail

SensorsJMSPublisher

public SensorsJMSPublisher(boolean publish)
Create a SensorsJMSPublisher

Parameters:
publish - - true to publish to InstrumentProxy, false simply outputs packets to System.out

SensorsJMSPublisher

public SensorsJMSPublisher()
Default SensorsJMSPublisher doesn't publish

Method Detail

publishData

public void publishData(DevicePacket pkt)
Publish packet to JMS server.

Parameters:
pkt - DevicePacket

printPacket

public void printPacket(DevicePacket pkt)
Print the pkt to System.out

Parameters:
pkt - DevicePacket

serviceInstalled

public void serviceInstalled(ServiceEvent event)
Description copied from interface: ServiceListener
Action performed when service installed

Specified by:
serviceInstalled in interface ServiceListener

serviceRemoved

public void serviceRemoved(ServiceEvent e)
Description copied from interface: ServiceListener
Action performed when service removed

Specified by:
serviceRemoved in interface ServiceListener

serviceRequestComplete

public void serviceRequestComplete(ServiceEvent e)
Description copied from interface: ServiceListener
Action performed when service request complete

Specified by:
serviceRequestComplete in interface ServiceListener

serviceSampleLogged

public void serviceSampleLogged(LogSampleServiceEvent event)
Called whenever an InstrumentService logs a sample


getUUID

protected java.lang.String getUUID(long isiId)
Find the ISI ID for a given device (ISI) ID


getProxy

protected org.mbari.instrument.InstrumentProxy getProxy(long isiId)
Find or create an InstrumentProxy for this ISI ID



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.