org.mbari.siam.core
Class NodeProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by org.mbari.siam.core.SiamProperties
                  extended by org.mbari.siam.core.NodeProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>
Direct Known Subclasses:
FOCENodeProperties, MOOSNodeProperties

public class NodeProperties
extends SiamProperties

NodeProperties is responsible for parsing the Node properties file (typically siamPort.cfg) in order to configure the Node.

See Also:
Serialized Form

Field Summary
static java.lang.String ADVERTISE_SERVICE_KEY
           
static java.lang.String CODEBASE_DIRECTORY_KEY
           
static java.lang.String COMMS_MODE_KEY
           
static java.lang.String DATA_SHELF_LIFE
           
static java.lang.String DEVICELOG_DIRECTORY_KEY
           
static java.lang.String HTTP_PORT_KEY
           
static java.lang.String MAX_PORTS_KEY
           
static java.lang.String MAX_REASSERT_COMMLINK_TRIES
           
static java.lang.String MISC_PORT_KEY
           
static java.lang.String NODE_DIAGNOSTIC_INTERVAL_KEY
           
static java.lang.String NODEID_KEY
           
static java.lang.String NVT_SERIAL_PORT_KEY
           
static java.lang.String PORT_ALIAS_KEY
           
static java.lang.String PORTNAME_KEY
           
static java.lang.String PORTNAMES_KEY
           
static java.lang.String POWER_PORT_KEY
           
static java.lang.String REASSERT_COMMLINK
           
static java.lang.String SERIAL_PORT_KEY
           
static java.lang.String SERVICE_JAR_KEY
           
static java.lang.String SERVICEJAR_DIRECTORY_KEY
           
static java.lang.String USE_PUCK_PAYLOAD_KEY
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
NodeProperties()
           
 
Method Summary
 java.lang.String getCodebaseDirectory()
          Get name of codebase directory.
 float getDataShelfLifeHours()
          Get data shelf-life (default is unlimited shelf-life)
 java.lang.String getDeviceLogDirectory()
          Get name of sensor log directory.
 int getDiagnosticInterval()
          Get node diagnostic interval (seconds).
protected  org.mbari.siam.core.HttpDevicePort getHttpDevicePort(int index, java.lang.String url, PowerPort powerPort, java.lang.String jarName)
          Create HttpDevicePort
 int getMaxPorts()
          Get node diagnostic interval (seconds).
 long getNodeID()
          Get Node ID.
protected  SerialDevicePort getNVTDevicePort(int index, java.lang.String portId, PowerPort powerPort, java.lang.String jarName, CommsMode commsMode)
          Create an NVTDevicePort.
protected  DevicePort getPlatformPort(int index, PowerPort powerPort, java.lang.String jar, CommsMode commsMode)
          Look for platform-specific DevicePorts.
 DevicePort getPort(int index)
          getPort() is responsible for parsing siamPort.cfg and creating the DevicePorts specified there.
 PowerPort getPowerPort(java.lang.String key)
          Look for the power port.
protected  SerialDevicePort getSerialDevicePort(int index, java.lang.String portName, PowerPort powerPort, java.lang.String jarName, CommsMode commsMode)
          Create a SerialDevicePort (or subclass).
 java.lang.String getSerialPortNames()
          Get names of node serial ports.
 java.lang.String getServiceJarDirectory()
          Get name of service jar directory.
 int maxReassertCommLinkTries()
          Return true (default) if node should reassert prematurely broken comms link
 boolean reassertCommsLink()
          Return true (default) if node should reassert prematurely broken comms link
 
Methods inherited from class org.mbari.siam.core.SiamProperties
getChannelRangeProperty, getIntegerArrayProperty, getIntegerProperty, getIntegerProperty, getLongProperty, getLongProperty, getNonNegativeIntegerProperty, getProperty, getProperty, getRequiredProperty, getStringArrayProperty, parseChannelRangeProperty, parseInteger, parseStringArrayProperty
 
Methods inherited from class java.util.Properties
list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NODEID_KEY

public static final java.lang.String NODEID_KEY
See Also:
Constant Field Values

PORTNAMES_KEY

public static final java.lang.String PORTNAMES_KEY
See Also:
Constant Field Values

SERVICEJAR_DIRECTORY_KEY

public static final java.lang.String SERVICEJAR_DIRECTORY_KEY
See Also:
Constant Field Values

DEVICELOG_DIRECTORY_KEY

public static final java.lang.String DEVICELOG_DIRECTORY_KEY
See Also:
Constant Field Values

CODEBASE_DIRECTORY_KEY

public static final java.lang.String CODEBASE_DIRECTORY_KEY
See Also:
Constant Field Values

ADVERTISE_SERVICE_KEY

public static final java.lang.String ADVERTISE_SERVICE_KEY
See Also:
Constant Field Values

USE_PUCK_PAYLOAD_KEY

public static final java.lang.String USE_PUCK_PAYLOAD_KEY
See Also:
Constant Field Values

COMMS_MODE_KEY

public static final java.lang.String COMMS_MODE_KEY
See Also:
Constant Field Values

HTTP_PORT_KEY

public static final java.lang.String HTTP_PORT_KEY
See Also:
Constant Field Values

SERIAL_PORT_KEY

public static final java.lang.String SERIAL_PORT_KEY
See Also:
Constant Field Values

POWER_PORT_KEY

public static final java.lang.String POWER_PORT_KEY
See Also:
Constant Field Values

SERVICE_JAR_KEY

public static final java.lang.String SERVICE_JAR_KEY
See Also:
Constant Field Values

PORTNAME_KEY

public static final java.lang.String PORTNAME_KEY
See Also:
Constant Field Values

MAX_PORTS_KEY

public static final java.lang.String MAX_PORTS_KEY
See Also:
Constant Field Values

DATA_SHELF_LIFE

public static final java.lang.String DATA_SHELF_LIFE
See Also:
Constant Field Values

REASSERT_COMMLINK

public static final java.lang.String REASSERT_COMMLINK
See Also:
Constant Field Values

MAX_REASSERT_COMMLINK_TRIES

public static final java.lang.String MAX_REASSERT_COMMLINK_TRIES
See Also:
Constant Field Values

NVT_SERIAL_PORT_KEY

public static final java.lang.String NVT_SERIAL_PORT_KEY
See Also:
Constant Field Values

MISC_PORT_KEY

public static final java.lang.String MISC_PORT_KEY
See Also:
Constant Field Values

PORT_ALIAS_KEY

public static final java.lang.String PORT_ALIAS_KEY
See Also:
Constant Field Values

NODE_DIAGNOSTIC_INTERVAL_KEY

public static final java.lang.String NODE_DIAGNOSTIC_INTERVAL_KEY
See Also:
Constant Field Values
Constructor Detail

NodeProperties

public NodeProperties()
Method Detail

getSerialPortNames

public java.lang.String getSerialPortNames()
                                    throws MissingPropertyException,
                                           InvalidPropertyException
Get names of node serial ports.

Throws:
MissingPropertyException
InvalidPropertyException

getServiceJarDirectory

public java.lang.String getServiceJarDirectory()
                                        throws MissingPropertyException,
                                               InvalidPropertyException
Get name of service jar directory.

Throws:
MissingPropertyException
InvalidPropertyException

getDeviceLogDirectory

public java.lang.String getDeviceLogDirectory()
                                       throws MissingPropertyException,
                                              InvalidPropertyException
Get name of sensor log directory.

Throws:
MissingPropertyException
InvalidPropertyException

getCodebaseDirectory

public java.lang.String getCodebaseDirectory()
                                      throws MissingPropertyException,
                                             InvalidPropertyException
Get name of codebase directory.

Throws:
MissingPropertyException
InvalidPropertyException

getDiagnosticInterval

public int getDiagnosticInterval()
                          throws InvalidPropertyException
Get node diagnostic interval (seconds).

Throws:
InvalidPropertyException

getMaxPorts

public int getMaxPorts()
Get node diagnostic interval (seconds).


getPort

public DevicePort getPort(int index)
                   throws MissingPropertyException
getPort() is responsible for parsing siamPort.cfg and creating the DevicePorts specified there.

Parameters:
index - - the index number of the DevicePort. The entries in siamPort.cfg should end with this index number.
Throws:
MissingPropertyException

getPowerPort

public PowerPort getPowerPort(java.lang.String key)
                       throws MissingPropertyException
Look for the power port. This implementation just returns a NullPowerPort. Should be overridden by the platform-specific subclass of NodeProperties.

Parameters:
key - - Property key for the PowerPort.
Throws:
MissingPropertyException

getHttpDevicePort

protected org.mbari.siam.core.HttpDevicePort getHttpDevicePort(int index,
                                                               java.lang.String url,
                                                               PowerPort powerPort,
                                                               java.lang.String jarName)
Create HttpDevicePort


getSerialDevicePort

protected SerialDevicePort getSerialDevicePort(int index,
                                               java.lang.String portName,
                                               PowerPort powerPort,
                                               java.lang.String jarName,
                                               CommsMode commsMode)
Create a SerialDevicePort (or subclass). May be overridden by platform-specific subclass of NodeProperties.


getNVTDevicePort

protected SerialDevicePort getNVTDevicePort(int index,
                                            java.lang.String portId,
                                            PowerPort powerPort,
                                            java.lang.String jarName,
                                            CommsMode commsMode)
Create an NVTDevicePort.


getPlatformPort

protected DevicePort getPlatformPort(int index,
                                     PowerPort powerPort,
                                     java.lang.String jar,
                                     CommsMode commsMode)
                              throws MissingPropertyException
Look for platform-specific DevicePorts. Called after base class didn't find standard device ports. Default implementation just returns throws a MissingPropertyException.

Parameters:
index - - the index number of the DevicePort.
Throws:
MissingPropertyException

getNodeID

public long getNodeID()
               throws MissingPropertyException,
                      InvalidPropertyException
Get Node ID.

Throws:
MissingPropertyException
InvalidPropertyException

getDataShelfLifeHours

public float getDataShelfLifeHours()
                            throws InvalidPropertyException
Get data shelf-life (default is unlimited shelf-life)

Throws:
InvalidPropertyException

reassertCommsLink

public boolean reassertCommsLink()
                          throws InvalidPropertyException
Return true (default) if node should reassert prematurely broken comms link

Throws:
InvalidPropertyException

maxReassertCommLinkTries

public int maxReassertCommLinkTries()
                             throws InvalidPropertyException
Return true (default) if node should reassert prematurely broken comms link

Throws:
InvalidPropertyException


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.