org.mbari.siam.moos.deployed
Class MOOSNetworkManager

java.lang.Object
  extended by org.mbari.siam.moos.deployed.MOOSNetworkManager
All Implemented Interfaces:
NetworkManager

public class MOOSNetworkManager
extends java.lang.Object
implements NetworkManager

MOOSNetworkManager includes methods to manage power and communications on the MOOS deployed network.


Field Summary
protected  java.net.InetAddress _bcastAddress
           
protected  java.net.DatagramSocket _dgSocket
           
static java.lang.String BCAST_NAME
           
protected static int SO_TIMEOUT
           
protected static int WAKEUP_SERVICE_PORT
           
 
Constructor Summary
MOOSNetworkManager(java.lang.String localInterfaceName)
          Create the NetworkManager.
 
Method Summary
 void keepNodeAwake(java.net.InetAddress node, int msec)
          Keep specified node awake for specified duration.
protected  void sendWakeupPacket(java.net.InetAddress node)
          Broadcast wakeup packet, with address of target node as payload.
 void wakeupAllNodes()
          Send wakeup signals to all nodes.
 void wakeupNode(java.net.InetAddress node)
          Send wakeup signal to specified node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dgSocket

protected java.net.DatagramSocket _dgSocket

BCAST_NAME

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

WAKEUP_SERVICE_PORT

protected static final int WAKEUP_SERVICE_PORT
See Also:
Constant Field Values

SO_TIMEOUT

protected static final int SO_TIMEOUT
See Also:
Constant Field Values

_bcastAddress

protected java.net.InetAddress _bcastAddress
Constructor Detail

MOOSNetworkManager

public MOOSNetworkManager(java.lang.String localInterfaceName)
                   throws java.net.UnknownHostException,
                          java.net.SocketException
Create the NetworkManager. Specify name of local interface to MOOS network (e.g. "mooring", "shore", etc).

Throws:
java.net.UnknownHostException
java.net.SocketException
Method Detail

wakeupNode

public void wakeupNode(java.net.InetAddress node)
                throws java.io.IOException
Send wakeup signal to specified node.

Specified by:
wakeupNode in interface NetworkManager
Throws:
java.io.IOException

wakeupAllNodes

public void wakeupAllNodes()
                    throws java.io.IOException
Send wakeup signals to all nodes.

Specified by:
wakeupAllNodes in interface NetworkManager
Throws:
java.io.IOException

keepNodeAwake

public void keepNodeAwake(java.net.InetAddress node,
                          int msec)
                   throws java.io.IOException
Keep specified node awake for specified duration.

Specified by:
keepNodeAwake in interface NetworkManager
Throws:
java.io.IOException

sendWakeupPacket

protected void sendWakeupPacket(java.net.InetAddress node)
                         throws java.io.IOException
Broadcast wakeup packet, with address of target node as payload. If specified node is null, form packet payload to indicate wakeup all nodes.

Throws:
java.io.IOException


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.