org.mbari.siam.core
Class NodeManager

java.lang.Object
  extended by org.mbari.siam.core.NodeManager
All Implemented Interfaces:
java.util.EventListener, ServiceListener, Parent

public class NodeManager
extends java.lang.Object
implements Parent, ServiceListener

NodeManager implements node functionality, and instantiates component objects including NodeService, PortManager, etc.


Field Summary
protected  java.lang.String _cfgFile
           
protected  java.util.Vector _eventCallbacks
           
protected  FilteredDeviceLogIF _log
           
protected  java.net.InetAddress _networkSwitchAddress
           
protected  NodeConfigurator _nodeConfigurator
           
protected  long _nodeID
           
protected  NodeProperties _nodeProperties
           
protected  NodeService _nodeService
           
protected  long _nodeStartTime
           
protected  PortManager _portManager
           
protected  java.lang.String _siamHome
           
protected  SleepManager _sleepManager
           
protected static NodeManager _theNodeManager
           
protected  WDTManager _wdtManager
           
protected static java.lang.String DISK_SPACE_USAGE_CMD
           
protected static java.lang.String GET_MAC_ADDRESS_CMD
           
protected static java.lang.String GLOBALSTAR_STATUS_CMD
           
protected static java.lang.String OPTICAL_STATUS_CMD
           
protected static java.lang.String PPP_STATUS_CMD
           
protected static java.lang.String RFIO_STATUS_CMD
           
 
Method Summary
 void addEventCallback(NodeEventCallback callback)
          Add a remote callback to the to-be-notified list.
protected  long getId()
          Return ISI ID of node.
static NodeManager getInstance()
          Method to get singleton instance.
static NodeManager getInstance(NodeConfigurator configurator)
          Method to get singleton instance.
 Location getLocation(long deviceID)
          Return the location of the requested ISI ID.
 java.net.InetAddress getNetworkSwitchAddress()
          Return Network Switch Inet Address
 NodeConfigurator getNodeConfigurator()
          Return NodeConfigurator.
protected  NodeProperties getNodeProperties()
          Return node properties.
 NodeService getNodeService()
          Return NodeService singleton.
 long getNodeStartTime()
          Return Node start time
 long getParentId()
          Return the ISI ID of this node.
 PortManager getPortManager()
          Return PortManager singleton.
protected  java.lang.String getSiamHome()
          Return SIAM home directory.
 java.lang.String getSleepSummary()
          Return summary of sleep manager operations.
 java.lang.String getSoftwareVersion()
          Return software version information.
protected  java.lang.String getStatus(boolean logPackets)
          Get status of various node subsystems, and return string representation; log status packets if 'logPackets' is true.
 void logMessage(java.lang.String message)
          Write a message packet to the Node log.
protected  void logNodeConfiguration(java.lang.String prefix)
          Log the current instrument list, etc.
protected  void logPacket(DevicePacket packet)
          Write a DevicePacket to the Node log, and publish the LogSampleServiceEvent
 boolean powerAvailable(int milliamp)
          Request power from the parent; return true if available, false if not available.
 void publish(java.util.EventObject event)
          Publish the specified event.
 void runDiagnostics(java.lang.String note)
          Run diagnostic procedure; called through Parent interface
 void serviceInstalled(ServiceEvent event)
          Action performed when service installed
 void serviceRemoved(ServiceEvent event)
          Action performed when service removed
 void serviceRequestComplete(ServiceEvent e)
          Action performed when service request complete
 void serviceSampleLogged(LogSampleServiceEvent e)
           
 void start(java.lang.String name, java.lang.String portalHost)
          Start the NodeManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RFIO_STATUS_CMD

protected static final java.lang.String RFIO_STATUS_CMD
See Also:
Constant Field Values

GLOBALSTAR_STATUS_CMD

protected static final java.lang.String GLOBALSTAR_STATUS_CMD
See Also:
Constant Field Values

GET_MAC_ADDRESS_CMD

protected static final java.lang.String GET_MAC_ADDRESS_CMD
See Also:
Constant Field Values

PPP_STATUS_CMD

protected static final java.lang.String PPP_STATUS_CMD
See Also:
Constant Field Values

OPTICAL_STATUS_CMD

protected static final java.lang.String OPTICAL_STATUS_CMD
See Also:
Constant Field Values

DISK_SPACE_USAGE_CMD

protected static final java.lang.String DISK_SPACE_USAGE_CMD
See Also:
Constant Field Values

_nodeID

protected long _nodeID

_nodeConfigurator

protected NodeConfigurator _nodeConfigurator

_portManager

protected PortManager _portManager

_nodeService

protected NodeService _nodeService

_sleepManager

protected SleepManager _sleepManager

_wdtManager

protected WDTManager _wdtManager

_theNodeManager

protected static NodeManager _theNodeManager

_nodeProperties

protected NodeProperties _nodeProperties

_siamHome

protected java.lang.String _siamHome

_log

protected FilteredDeviceLogIF _log

_eventCallbacks

protected java.util.Vector _eventCallbacks

_networkSwitchAddress

protected java.net.InetAddress _networkSwitchAddress

_nodeStartTime

protected long _nodeStartTime

_cfgFile

protected java.lang.String _cfgFile
Method Detail

getInstance

public static NodeManager getInstance(NodeConfigurator configurator)
Method to get singleton instance.


getInstance

public static NodeManager getInstance()
Method to get singleton instance.


start

public void start(java.lang.String name,
                  java.lang.String portalHost)
           throws java.io.IOException,
                  InvalidPropertyException,
                  MissingPropertyException
Start the NodeManager.

Throws:
java.io.IOException
InvalidPropertyException
MissingPropertyException

getId

protected long getId()
Return ISI ID of node.


getNodeProperties

protected NodeProperties getNodeProperties()
Return node properties.


getSiamHome

protected java.lang.String getSiamHome()
                                throws MissingPropertyException
Return SIAM home directory.

Throws:
MissingPropertyException

logPacket

protected void logPacket(DevicePacket packet)
Write a DevicePacket to the Node log, and publish the LogSampleServiceEvent


logMessage

public void logMessage(java.lang.String message)
Write a message packet to the Node log.


getPortManager

public PortManager getPortManager()
Return PortManager singleton.


getNodeService

public NodeService getNodeService()
Return NodeService singleton.


getNodeConfigurator

public NodeConfigurator getNodeConfigurator()
Return NodeConfigurator.


logNodeConfiguration

protected void logNodeConfiguration(java.lang.String prefix)
Log the current instrument list, etc.


addEventCallback

public void addEventCallback(NodeEventCallback callback)
Add a remote callback to the to-be-notified list.


serviceInstalled

public void serviceInstalled(ServiceEvent event)
Description copied from interface: ServiceListener
Action performed when service installed

Specified by:
serviceInstalled in interface ServiceListener

serviceRemoved

public void serviceRemoved(ServiceEvent event)
Description copied from interface: ServiceListener
Action performed when service removed

Specified by:
serviceRemoved in interface ServiceListener

serviceRequestComplete

public void serviceRequestComplete(ServiceEvent e)
Description copied from interface: ServiceListener
Action performed when service request complete

Specified by:
serviceRequestComplete in interface ServiceListener

serviceSampleLogged

public void serviceSampleLogged(LogSampleServiceEvent e)

getSleepSummary

public java.lang.String getSleepSummary()
Return summary of sleep manager operations.


getParentId

public long getParentId()
Return the ISI ID of this node. In fulfullment of the Parent Interface.

Specified by:
getParentId in interface Parent

getLocation

public Location getLocation(long deviceID)
Return the location of the requested ISI ID. In fulfillment of the Parent Interface.

Specified by:
getLocation in interface Parent

runDiagnostics

public void runDiagnostics(java.lang.String note)
                    throws java.lang.Exception
Run diagnostic procedure; called through Parent interface

Specified by:
runDiagnostics in interface Parent
Throws:
java.lang.Exception

getSoftwareVersion

public java.lang.String getSoftwareVersion()
Return software version information.

Specified by:
getSoftwareVersion in interface Parent

getNodeStartTime

public long getNodeStartTime()
Return Node start time


getNetworkSwitchAddress

public java.net.InetAddress getNetworkSwitchAddress()
Return Network Switch Inet Address


publish

public void publish(java.util.EventObject event)
Publish the specified event. Event published must be an instance of NodeEvent.

Specified by:
publish in interface Parent

getStatus

protected java.lang.String getStatus(boolean logPackets)
                              throws java.rmi.RemoteException
Get status of various node subsystems, and return string representation; log status packets if 'logPackets' is true.

Throws:
java.rmi.RemoteException

powerAvailable

public boolean powerAvailable(int milliamp)
Request power from the parent; return true if available, false if not available.

Specified by:
powerAvailable in interface Parent


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.