org.mbari.siam.operations.utils
Class PortUtility

java.lang.Object
  extended by org.mbari.siam.operations.utils.NodeUtility
      extended by org.mbari.siam.operations.utils.PortUtility
Direct Known Subclasses:
CacheInstrumentProperties, CO2MonitorUtil, ElmoClientExample, ElmoRMI, GetLastSample, InstrumentClockSetter, PortRestarter, PortSampler, PortScanner, PortStatus, PortStopper, PowerDownPort, PowerUpPort, PrintInstrumentProperties, RecorderUtility, RecorderUtility, ResetTurnsCounter, ResumeService, SetInstrumentProperty, SuspendService, Turbinator, ValveUtility

public abstract class PortUtility
extends NodeUtility

PortUtility is a NodeUtility that operates on a node's instrument ports. PortUtility is the base class of an "application framework"; to build an application, extend PortUtility and implement PortUtility's virtual methods. Note that an application that is not subclassed from PortUtility can make use of the public static getPortName() method.

Author:
Tom O'Reilly

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mbari.siam.operations.utils.NodeUtility
NodeUtility.InvalidOption
 
Field Summary
protected  java.util.Vector _portNames
           
 
Fields inherited from class org.mbari.siam.operations.utils.NodeUtility
_log4j, _node, _nodeHost, _nodeURL
 
Constructor Summary
PortUtility()
           
 
Method Summary
static java.lang.String getPortName(java.lang.String input)
          Return full port name corresponding to input, which may be abbreviated.
 void multiPortsAllowed(boolean allowed)
          Set whether multiple ports can be specified on command line.
 void processArguments(java.lang.String[] args)
          Process command line options.
 void processArguments(java.lang.String[] args, int requiredArgs)
          Process command line options and specify the minimum number of arguments required.
 void processNode(Node node)
          Do application-specific processing on each port.
abstract  void processPort(Node node, java.lang.String portName)
          Do application-specific processing of specified port.
 
Methods inherited from class org.mbari.siam.operations.utils.NodeUtility
getHostName, getNodeURL, printUsage, processCustomOption, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_portNames

protected java.util.Vector _portNames
Constructor Detail

PortUtility

public PortUtility()
Method Detail

processArguments

public void processArguments(java.lang.String[] args)
Process command line options. The first command line argument is always the node server's URL or hostname, followed by one or more port specifiers.

Overrides:
processArguments in class NodeUtility

multiPortsAllowed

public void multiPortsAllowed(boolean allowed)
Set whether multiple ports can be specified on command line.


processArguments

public void processArguments(java.lang.String[] args,
                             int requiredArgs)
Process command line options and specify the minimum number of arguments required. The first command line argument is always the node server's URL or hostname, followed by one or more port specifiers.

Overrides:
processArguments in class NodeUtility

processNode

public void processNode(Node node)
Do application-specific processing on each port.

Specified by:
processNode in class NodeUtility

getPortName

public static final java.lang.String getPortName(java.lang.String input)
Return full port name corresponding to input, which may be abbreviated. If the input is simply an integer, the string "/dev/ttySX" + input is returned. If the input begins with "tty", the string "/dev/" + input is returned. If the input is not simply an integer string and the input does not begin with "tty", it is assumed that the input is a full unabbreviated port name, and the input is returned as-is.


processPort

public abstract void processPort(Node node,
                                 java.lang.String portName)
                          throws java.rmi.RemoteException
Do application-specific processing of specified port.

Throws:
java.rmi.RemoteException


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.