|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcore.NetworkLayer
public class NetworkLayer
Network layer of a DTNHost. Takes care of connectivity among hosts.
| Field Summary | |
|---|---|
static java.lang.String |
RANGE_ID
ModuleCommunicationBus identifier for the "radio range"
variable. |
static java.lang.String |
SCAN_INTERVAL_ID
ModuleCommunicationBus identifier for the "scanning interval"
variable. |
static java.lang.String |
SPEED_ID
ModuleCommunicationBus identifier for the "transmission speed"
variable. |
| Constructor Summary | |
|---|---|
NetworkLayer(DTNHost host,
java.util.List<ConnectionListener> cListeners,
ModuleCommunicationBus comBus)
Constructor. |
|
| Method Summary | |
|---|---|
void |
connect(DTNHost anotherHost)
Tries to connect this host to another host. |
void |
createConnection(DTNHost anotherHost)
Creates a connection to another host. |
void |
destroyConnection(DTNHost anotherHost)
Disconnect a connection between this and another host. |
int |
getAddress()
Returns the network layer address. |
java.util.List<Connection> |
getConnections()
Returns a list of currently connected connections |
double |
getTransmitRange()
Returns the transmit range of this network layer |
int |
getTransmitSpeed()
Returns the transmit speed of this network layer |
boolean |
isScanning()
|
void |
moduleValueChanged(java.lang.String key,
java.lang.Object newValue)
This method is called by the ModuleCommunicationBus when/if
someone changes the scanning interval, transmit speed, or range |
static void |
reset()
Resets the static fields of the class |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
update()
Updates the state of current connections (i.e. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SCAN_INTERVAL_ID
ModuleCommunicationBus identifier for the "scanning interval"
variable.
public static final java.lang.String RANGE_ID
ModuleCommunicationBus identifier for the "radio range"
variable. Value type: double
public static final java.lang.String SPEED_ID
ModuleCommunicationBus identifier for the "transmission speed"
variable. Value type: integer
| Constructor Detail |
|---|
public NetworkLayer(DTNHost host,
java.util.List<ConnectionListener> cListeners,
ModuleCommunicationBus comBus)
host - The host where this network layer iscListeners - ConnectionListenerscomBus - Communication bus| Method Detail |
|---|
public int getAddress()
public double getTransmitRange()
public int getTransmitSpeed()
public java.util.List<Connection> getConnections()
public boolean isScanning()
public void connect(DTNHost anotherHost)
anotherHost - The host to try to connect topublic void createConnection(DTNHost anotherHost)
connect(DTNHost)).
anotherHost - The host to create the connection topublic void destroyConnection(DTNHost anotherHost)
anotherHost - The host to disconnect from this hostpublic void update()
public void moduleValueChanged(java.lang.String key,
java.lang.Object newValue)
ModuleCommunicationBus when/if
someone changes the scanning interval, transmit speed, or range
moduleValueChanged in interface ModuleCommunicationListenerkey - Identifier of the changed valuenewValue - New value for the variablepublic java.lang.String toString()
toString in class java.lang.Objectpublic static void reset()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||