org.mbari.siam.operations.utils
Class PublishToRBNB

java.lang.Object
  extended by org.mbari.siam.operations.utils.NodeUtility
      extended by org.mbari.siam.operations.utils.PublishToRBNB

public class PublishToRBNB
extends NodeUtility


Nested Class Summary
protected  class PublishToRBNB.InstrumentDesc
          Class to encapsulate one Instrument
protected  class PublishToRBNB.PubProperties
          Class to encapsulate properties, either globally or particular to one device
protected  class PublishToRBNB.RecordDesc
          Class to encapsulate one RecordType from one Instrument
protected  class PublishToRBNB.ShutdownThread
          Thread passed to addShutdownHook to shutdown the application
protected  class PublishToRBNB.UpdateTask
          TimerTask to update all instruments
 
Nested classes/interfaces inherited from class org.mbari.siam.operations.utils.NodeUtility
NodeUtility.InvalidOption
 
Field Summary
protected  java.util.Calendar _calendar
           
protected  long[] _deviceIDs
           
protected  long[] _excludeIDs
           
protected  PublishToRBNB.PubProperties _globalProps
           
protected  java.lang.String _home
           
protected  java.util.Vector _instruments
           
protected static org.apache.log4j.Logger _log4j
           
protected  Node _node
           
protected  java.lang.String _propertyFile
           
protected  SiamProperties _props
           
protected  long _pubSize
           
protected  java.lang.String _rbnbServer
           
protected  long _runDuration
           
protected  long _startTime
           
protected  java.util.Timer _timer
           
protected  PacketFilter[] filter
           
 
Fields inherited from class org.mbari.siam.operations.utils.NodeUtility
_nodeHost, _nodeURL
 
Constructor Summary
PublishToRBNB()
          Constructor
 
Method Summary
protected  long[] addOneLong(long[] array, java.lang.String newStr)
          Routine to add one long value to a long[] array
protected  void detachInstruments()
          Call detach() for each InstrumentDesc
protected  long getDuration(java.lang.String s)
          Get command-line arg expressed a duration, as nnn[s|m|h|d] [p] '' or 's' means seconds [p] 'm' means minutes [p] 'h' means hours [p] 'd' means days
 void getInstruments(Node node)
          Get the SIAM Instruments to process
protected  long[] getLongArrayProperty(SiamProperties props, java.lang.String name)
          Kludge that calls _props.getIntegerArrayProperty, and copies to long[] array.
protected  boolean isExcluded(long id)
          Return true if id is in _excludeIDs[]
static void main(java.lang.String[] args)
          Main() routine of application
 SiamProperties openPropertiesFile(java.lang.String[] args)
          Find, open, and read the Properties file
 void printParms()
          Print operational parameters to System.out
 void printUsage()
          Print Usage message
 boolean processArgs(java.lang.String[] args)
          Process the command-line arguments
 void processNode(Node node)
          Process the data from the SIAM Node, publishing to the RBNB Host
 void readGlobalProperties()
          Read the properties from the Properties file into the _globalProps object
protected  void updateInstruments(long duration)
          Call update() for each InstrumentDesc
 
Methods inherited from class org.mbari.siam.operations.utils.NodeUtility
getHostName, getNodeURL, processArguments, processArguments, processCustomOption, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j

_calendar

protected java.util.Calendar _calendar

_node

protected Node _node

_props

protected SiamProperties _props

_globalProps

protected PublishToRBNB.PubProperties _globalProps

_startTime

protected long _startTime

_runDuration

protected long _runDuration

_pubSize

protected long _pubSize

_rbnbServer

protected java.lang.String _rbnbServer

_propertyFile

protected java.lang.String _propertyFile

_home

protected java.lang.String _home

_deviceIDs

protected long[] _deviceIDs

filter

protected PacketFilter[] filter

_excludeIDs

protected long[] _excludeIDs

_instruments

protected java.util.Vector _instruments

_timer

protected java.util.Timer _timer
Constructor Detail

PublishToRBNB

public PublishToRBNB()
Constructor

Method Detail

processNode

public void processNode(Node node)
                 throws java.lang.Exception
Process the data from the SIAM Node, publishing to the RBNB Host

Specified by:
processNode in class NodeUtility
Throws:
java.lang.Exception

getInstruments

public void getInstruments(Node node)
                    throws java.lang.Exception
Get the SIAM Instruments to process

Throws:
java.lang.Exception

detachInstruments

protected void detachInstruments()
Call detach() for each InstrumentDesc


updateInstruments

protected void updateInstruments(long duration)
                          throws java.lang.Exception
Call update() for each InstrumentDesc

Throws:
java.lang.Exception

isExcluded

protected boolean isExcluded(long id)
Return true if id is in _excludeIDs[]


openPropertiesFile

public SiamProperties openPropertiesFile(java.lang.String[] args)
                                  throws java.io.FileNotFoundException,
                                         java.io.IOException,
                                         java.lang.SecurityException
Find, open, and read the Properties file

Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.SecurityException

readGlobalProperties

public void readGlobalProperties()
Read the properties from the Properties file into the _globalProps object


getLongArrayProperty

protected long[] getLongArrayProperty(SiamProperties props,
                                      java.lang.String name)
Kludge that calls _props.getIntegerArrayProperty, and copies to long[] array.


processArgs

public boolean processArgs(java.lang.String[] args)
Process the command-line arguments


addOneLong

protected long[] addOneLong(long[] array,
                            java.lang.String newStr)
                     throws java.lang.NumberFormatException
Routine to add one long value to a long[] array

Throws:
java.lang.NumberFormatException

getDuration

protected long getDuration(java.lang.String s)
                    throws java.text.ParseException,
                           java.lang.NumberFormatException
Get command-line arg expressed a duration, as nnn[s|m|h|d] [p] '' or 's' means seconds [p] 'm' means minutes [p] 'h' means hours [p] 'd' means days

Throws:
java.text.ParseException
java.lang.NumberFormatException

printParms

public void printParms()
Print operational parameters to System.out


printUsage

public void printUsage()
Print Usage message

Specified by:
printUsage in class NodeUtility

main

public static void main(java.lang.String[] args)
Main() routine of application



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.