public class DangerApplication extends Application
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APP_ID
Application ID
|
static java.lang.String |
DANGER_KEY_MESSAGE
Danger Key Message
|
static java.lang.String |
KNOWN_ACCIDENTS_KEY_MESSAGE
Known Accidents Key Message
|
static java.lang.String |
KNOWN_LOCATIONS_KEY_MESSAGE
Known Location Key Message
|
static java.lang.String |
MESSAGE_SIZE
Message size
|
static java.lang.String |
SEND_INTERVAL
Message sending interval
|
appID| Constructor and Description |
|---|
DangerApplication(DangerApplication a)
Copy-constructor
|
DangerApplication(Settings s)
Creates a new danger application with the given settings.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMessageSize() |
static int |
getNrofMessages() |
double |
getSendInterval() |
Message |
handle(Message msg,
DTNHost host)
Handles an incoming message.
|
Application |
replicate() |
void |
update(DTNHost host)
Creates warning message for other hosts in range
|
getAppID, getAppListeners, sendEventToListeners, setAppID, setAppListenerspublic static final java.lang.String SEND_INTERVAL
public static final java.lang.String MESSAGE_SIZE
public static final java.lang.String APP_ID
public static final java.lang.String DANGER_KEY_MESSAGE
public static final java.lang.String KNOWN_LOCATIONS_KEY_MESSAGE
public static final java.lang.String KNOWN_ACCIDENTS_KEY_MESSAGE
public DangerApplication(Settings s)
s - Settings to use for initializing the application.public DangerApplication(DangerApplication a)
a - public Message handle(Message msg, DTNHost host)
handle in class Applicationmsg - message received by the routerhost - host to which the application instance is attachednull
if the application wants the router to stop forwarding the
message.public Application replicate()
replicate in class Applicationpublic void update(DTNHost host)
update in class Applicationhost - to which the application instance is attachedpublic double getSendInterval()
public int getMessageSize()
public static int getNrofMessages()