core
Class DTN2Manager

java.lang.Object
  extended by core.DTN2Manager

public class DTN2Manager
extends java.lang.Object

Manages the external convergence layer connections to dtnd. Parses the configuration file and sets up the CLAParsers and EID->host mappings.


Nested Class Summary
static class DTN2Manager.EIDHost
          EID to DTNHost mapping elements.
 
Constructor Summary
DTN2Manager()
           
 
Method Summary
static void addBundle(java.lang.String id, Bundle bundle)
          Stores a reference to a bundle corresponding to the given message.
static Bundle getBundle(java.lang.String id)
          Returns the bundle associated with the given message id.
static DTN2Events getEvents()
          Returns the DTN2Events object.
static java.util.Collection<DTN2Manager.EIDHost> getHosts(java.lang.String EID)
          Returns a Collection of DTNHost objects corresponding to the given EID.
static CLAParser getParser(DTNHost host)
          Returns the ECL parser associated with the host.
static DTN2Reporter getReporter()
          Returns reference to the DTN2Reporter object.
static void setEvents(DTN2Events events)
          Sets the DTN2Events object.
static void setReporter(DTN2Reporter reporter)
          Sets the DTN2Reporter object used to pass messages from ONE to dtnd.
static void setup(World world)
          Sets up the dtnd connections by parsing the configuration file defined in the DTN2.configFile setting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTN2Manager

public DTN2Manager()
Method Detail

setup

public static void setup(World world)
Sets up the dtnd connections by parsing the configuration file defined in the DTN2.configFile setting.

Parameters:
world - reference to the world that contains the nodes

setReporter

public static void setReporter(DTN2Reporter reporter)
Sets the DTN2Reporter object used to pass messages from ONE to dtnd. This should be used by the dynamically loaded DTN2Reporter object to allow other objects get reference to it.

Parameters:
reporter - the reporter object to save reference to

getReporter

public static DTN2Reporter getReporter()
Returns reference to the DTN2Reporter object.

Returns:
reference to the active DTN2Reporter object

setEvents

public static void setEvents(DTN2Events events)
Sets the DTN2Events object.

Parameters:
events - the active events object to use

getEvents

public static DTN2Events getEvents()
Returns the DTN2Events object.

Returns:
the currently active events object.

getParser

public static CLAParser getParser(DTNHost host)
Returns the ECL parser associated with the host.

Parameters:
host - the host who's parser to return
Returns:
the host's parser.

getHosts

public static java.util.Collection<DTN2Manager.EIDHost> getHosts(java.lang.String EID)
Returns a Collection of DTNHost objects corresponding to the given EID.

Parameters:
EID - EID of the host
Returns:
the host corresponding to the EID

addBundle

public static void addBundle(java.lang.String id,
                             Bundle bundle)
Stores a reference to a bundle corresponding to the given message.

Parameters:
id - the id of the message
bundle - the bundle associated with the message

getBundle

public static Bundle getBundle(java.lang.String id)
Returns the bundle associated with the given message id.

Parameters:
id - the message id
Returns:
the bundle associated with the message