Skip to content
Snippets Groups Projects

Feature #224 add message priorities to application

2 files
+ 41
22
Compare changes
  • Side-by-side
  • Inline

Files

+ 33
16
@@ -9,30 +9,38 @@ public class BroadcastMessage extends Message {
/**
* Creates a new BroadcastMessage.
*
* @param from Who the message is (originally) from
* @param id Message identifier (must be unique for message but
* will be the same for all replicates of the message)
* @param size Size of the message (in bytes)
* @param from
* Who the message is (originally) from
* @param id
* Message identifier (must be unique for message but will be the
* same for all replicates of the message)
* @param size
* Size of the message (in bytes)
*/
public BroadcastMessage(DTNHost from, String id, int size) {
super(from, null, id, size);
}
/**
* Creates a new BroadcastMessage that also has a priority.
*
* @param from Who the message is (originally) from
* @param id Message identifier (must be unique for message but
* will be the same for all replicates of the message)
* @param size Size of the message (in bytes)
* @param prio Priority of the message
* @param from
* Who the message is (originally) from
* @param id
* Message identifier (must be unique for message but will be the
* same for all replicates of the message)
* @param size
* Size of the message (in bytes)
* @param prio
* Priority of the message
*/
public BroadcastMessage(DTNHost from, String id, int size, int prio){
super(from, null, id, size, prio);
public BroadcastMessage(DTNHost from, String id, int size, int prio) {
super(from, null, id, size, prio);
}
/**
* Returns the node this message is originally to
*
* @return the node this message is originally to
*/
@Override
@@ -43,7 +51,9 @@ public class BroadcastMessage extends Message {
/**
* Determines whether the provided node is a final recipient of the message.
* @param host Node to check.
*
* @param host
* Node to check.
* @return Whether the node is a final recipient of the message.
*/
@Override
@@ -52,9 +62,13 @@ public class BroadcastMessage extends Message {
}
/**
* Checks whether a successful sending to the provided DTNHost would mean a completed message delivery.
* @param receiver The node that the message is sent to.
* @return Whether or not delivery will be completed by a successful send operation.
* Checks whether a successful sending to the provided DTNHost would mean a
* completed message delivery.
*
* @param receiver
* The node that the message is sent to.
* @return Whether or not delivery will be completed by a successful send
* operation.
*/
@Override
public boolean completesDelivery(DTNHost receiver) {
@@ -63,6 +77,7 @@ public class BroadcastMessage extends Message {
/**
* Returns a string representation of the message's recipient(s).
*
* @return a string representation of the message's recipient(s).
*/
@Override
@@ -72,6 +87,7 @@ public class BroadcastMessage extends Message {
/**
* Returns a replicate of this message (identical except for the unique id)
*
* @return A replicate of the message
*/
@Override
@@ -83,6 +99,7 @@ public class BroadcastMessage extends Message {
/**
* Gets the message type.
*
* @return The message type.
*/
@Override
Loading