org.mbari.siam.core
Class DevicePacketPublisher

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

public class DevicePacketPublisher
extends java.lang.Object
implements LogSampleListener

DevicePacketPublisher instantiates an SSDS PublisherComponent and uses it to publish DevicePackets. This class was invented to facilitate creating a single application that acquires SIAM data and publishes it. Borrowed from class OasisPublisher in the OasisToSSDS project.

Author:
Bob Herlien
See Also:
NodeManager

Field Summary
protected static java.text.SimpleDateFormat _dateFormatter
           
protected  java.lang.String _defaultMetadata
           
protected  ExportablePacket _exportablePacket
           
protected  boolean _publish
           
protected  moos.ssds.jms.PublisherComponent _ssdsPublisher
           
 
Constructor Summary
DevicePacketPublisher()
          Create a PublisherComponent
DevicePacketPublisher(boolean publish)
          Create a PublisherComponent
 
Method Summary
 void printPacket(DevicePacket pkt)
          Print the pkt to System.out
 void publishData(DevicePacket pkt)
          Publish packet to JMS server.
 void sampleLogged(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

_dateFormatter

protected static java.text.SimpleDateFormat _dateFormatter

_ssdsPublisher

protected moos.ssds.jms.PublisherComponent _ssdsPublisher

_exportablePacket

protected ExportablePacket _exportablePacket

_defaultMetadata

protected java.lang.String _defaultMetadata

_publish

protected boolean _publish
Constructor Detail

DevicePacketPublisher

public DevicePacketPublisher(boolean publish)
Create a PublisherComponent

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

DevicePacketPublisher

public DevicePacketPublisher()
Create a PublisherComponent

Method Detail

publishData

public void publishData(DevicePacket pkt)
                 throws java.io.IOException
Publish packet to JMS server.

Parameters:
pkt - DevicePacket
Throws:
java.io.IOException

printPacket

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

Parameters:
pkt - DevicePacket

sampleLogged

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

Specified by:
sampleLogged in interface LogSampleListener


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.