org.mbari.siam.core
Class PortManager

java.lang.Object
  extended by org.mbari.siam.core.PortManager
Direct Known Subclasses:
FOCEPortManager, MOOSPortManager

public class PortManager
extends java.lang.Object

PortManager keeps track of devices installed on node ports.

Author:
Tom O'Reilly

Constructor Summary
PortManager(java.lang.String siamHome, NodeProperties nodeProps)
          Create PortManager object.
 
Method Summary
 byte[] closePort(DevicePort port)
          Close the port, shutdown associated service if any, free resources.
 byte[] closePort(DevicePort port, boolean enterSafeMode)
          Close the port, shutdown associated service if any, free resources; optionally put device in 'safe mode' before shutting down service.
 java.util.Vector getPorts()
          Get configuration of all ports.
 void initPortVector()
          Get port configuration from properties file and store in vector.
protected  java.lang.String loadFromPuck(Puck puck, Puck.Datasheet datasheet, ServiceSandBox sandBox)
          Return name of jar file retrieved from PUCK, or if no PUCK payload, return jar file name based on PUCK UUID.
protected  byte[] removeService(DevicePort port, boolean enterSafeMode)
          Remove service on specified port.
 void scanPort(DevicePort port, java.lang.String serviceSource)
          Scan specified port.
 void scanPorts()
          Determine configuration of all ports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortManager

public PortManager(java.lang.String siamHome,
                   NodeProperties nodeProps)
            throws MissingPropertyException,
                   InvalidPropertyException
Create PortManager object.

Throws:
MissingPropertyException
InvalidPropertyException
Method Detail

initPortVector

public void initPortVector()
                    throws java.io.IOException,
                           MissingPropertyException,
                           InvalidPropertyException
Get port configuration from properties file and store in vector.

Throws:
java.io.IOException
MissingPropertyException
InvalidPropertyException

getPorts

public java.util.Vector getPorts()
Get configuration of all ports.


scanPort

public void scanPort(DevicePort port,
                     java.lang.String serviceSource)
              throws java.lang.LinkageError,
                     PortOccupiedException,
                     java.io.IOException,
                     DuplicateIdException,
                     PortNotFound,
                     java.lang.Exception
Scan specified port.

Throws:
java.lang.LinkageError
PortOccupiedException
java.io.IOException
DuplicateIdException
PortNotFound
java.lang.Exception

closePort

public byte[] closePort(DevicePort port)
Close the port, shutdown associated service if any, free resources.


closePort

public byte[] closePort(DevicePort port,
                        boolean enterSafeMode)
Close the port, shutdown associated service if any, free resources; optionally put device in 'safe mode' before shutting down service.


scanPorts

public void scanPorts()
Determine configuration of all ports.


removeService

protected byte[] removeService(DevicePort port,
                               boolean enterSafeMode)
Remove service on specified port.


loadFromPuck

protected java.lang.String loadFromPuck(Puck puck,
                                        Puck.Datasheet datasheet,
                                        ServiceSandBox sandBox)
                                 throws java.lang.Exception
Return name of jar file retrieved from PUCK, or if no PUCK payload, return jar file name based on PUCK UUID. Extract jar file if necessary and manage sandbox.

Throws:
java.lang.Exception


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.