|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.RouteMessageImpl
Message that wold be routed throwghout network.
Field Summary | |
protected java.lang.String |
appId
The application Id who generates the related data and will receive on to remote Node. |
protected NodeHandle |
destination
Destination Node Id who will receive this message. |
protected java.lang.String |
key
Identification key of this message, necessary to known relationships between sent messages and new incoming messages. |
protected Message |
message
Message (data) to be routed |
protected int |
mode
Mode of this message. |
protected NodeHandle |
nextHop
Next node to arrive |
protected java.lang.Object |
options
RouteMessage additional options. |
protected NodeHandle |
previousHop
Previous node on path to current node. |
protected java.util.List |
route
Route from the source to the destination. |
protected NodeHandle |
source
Source Node Id who sends this message. |
protected int |
ttl
Time to live for the packet. |
protected int |
type
Type of this message. |
Constructor Summary | |
RouteMessageImpl(java.lang.String appId,
NodeHandle source,
NodeHandle destination,
Message data,
NodeHandle nextHop)
Constructor who initialize all data. |
|
RouteMessageImpl(java.lang.String appId,
NodeHandle to,
NodeHandle from,
NodeHandle nh,
Message msg,
java.lang.String key,
int type,
int mode)
Sets all values of the actual RouteMessage, before to be sent. |
Method Summary | |
void |
decTimeToLive()
Decreases the Time to Live for the packet. |
java.lang.String |
getApplicationId()
Gets the related application's identification. |
NodeHandle |
getDestination()
Get the destination node's NodeHandle. |
java.lang.String |
getKey()
Gets the identification key of this message. |
Message |
getMessage()
Get the Message to route. |
int |
getMode()
Gets the mode of this message. |
NodeHandle |
getNextHopHandle()
Get next node's NodeHandle to send this message. |
java.lang.Object |
getOptions()
|
NodeHandle |
getPreviousHopHandle()
Gets the previous hop handle for this message. |
java.util.Collection |
getRoute()
Returns the route from the source to the destination. |
NodeHandle |
getSource()
Gets de source Node NodeHandle of the message |
int |
getTimeToLive()
Gets the time to live for the packet. |
int |
getType()
Gets the type of this message. |
void |
inverse()
Reverse path. |
boolean |
routeMessagesHasExpired()
Returns true if RouteMessage has expired. |
void |
setApplicationId(java.lang.String app)
Sets the application's identification who sends and will receive this message. |
void |
setDestination(NodeHandle handle)
Sets the destination's NodeHandle. |
void |
setKey(java.lang.String key)
Sets the identification key of this communication. |
void |
setMessage(Message message)
Sets the Message to route. |
void |
setMode(int mode)
Sets the mode of this messge. |
void |
setNewNodeAlongRoute(NodeHandle node)
Adds a new node along the current path. |
void |
setNextHopHandle(NodeHandle nextHop)
Sets the next node's Id to send immediately this message. |
void |
setOptions(java.lang.Object o)
Set RouteMessage additional options. |
void |
setPreviousHopHandle(NodeHandle previousHop)
Sets the previous hop handle for this message. |
void |
setRoute(java.util.Collection route)
Sets the route for the new path from the source to the destination |
void |
setSource(NodeHandle handle)
Sets the source Node NodeHandle who sends this message. |
void |
setTimeToLive(int ttl)
Sets Time to Live For The Message. |
void |
setType(int type)
Sets the type of this message. |
void |
setValues(java.lang.String appId,
NodeHandle to,
NodeHandle from,
NodeHandle nh,
Message msg,
java.lang.String key,
int type,
int mode)
Sets all values of the actual RouteMessage, before to be sent. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String appId
protected Message message
protected NodeHandle nextHop
protected NodeHandle destination
protected NodeHandle source
protected NodeHandle previousHop
protected int type
protected int mode
protected java.lang.String key
protected java.lang.Object options
protected java.util.List route
protected int ttl
Constructor Detail |
public RouteMessageImpl(java.lang.String appId, NodeHandle source, NodeHandle destination, Message data, NodeHandle nextHop)
appId
- Application's identification who generates this data.source
- Source Node Id who sends this message.destination
- Destination Node Id who receive this message.data
- The generated data to application level.nextHop
- Next Node to hop in the ring.public RouteMessageImpl(java.lang.String appId, NodeHandle to, NodeHandle from, NodeHandle nh, Message msg, java.lang.String key, int type, int mode)
appId
- Identification of the Application which generate this
message.to
- Destination Id of this RouteMessage.from
- Source Id of this RouteMessage.nh
- NodeHandle for next hop.msg
- Message wrapped to this RouteMessage.key
- Identification key for this communication with the remote node.type
- Type of this message.mode
- Mode of this message.RouteMessage.setValues(java.lang.String, planet.commonapi.NodeHandle,planet.commonapi.NodeHandle, planet.commonapi.NodeHandle, planet.commonapi.Message, java.lang.String, int, int)
Method Detail |
public NodeHandle getDestination()
getDestination
in interface RouteMessage
RouteMessage.getDestination()
public Message getMessage()
getMessage
in interface RouteMessage
RouteMessage.getMessage()
public NodeHandle getNextHopHandle()
getNextHopHandle
in interface RouteMessage
RouteMessage.getNextHopHandle()
public void setDestination(NodeHandle handle)
setDestination
in interface RouteMessage
handle
- The destination NodeHandleRouteMessage.setDestination(planet.commonapi.NodeHandle)
public void setMessage(Message message)
setMessage
in interface RouteMessage
message
- The internal messageRouteMessage.setMessage(planet.commonapi.Message)
public void setNextHopHandle(NodeHandle nextHop)
setNextHopHandle
in interface RouteMessage
nextHop
- The next hop for this handleRouteMessage.setNextHopHandle(planet.commonapi.NodeHandle)
public NodeHandle getPreviousHopHandle()
getPreviousHopHandle
in interface RouteMessage
public void setPreviousHopHandle(NodeHandle previousHop)
setPreviousHopHandle
in interface RouteMessage
previousHop
- The previous hop to Set.public java.lang.String getApplicationId()
getApplicationId
in interface RouteMessage
RouteMessage.getApplicationId()
public NodeHandle getSource()
getSource
in interface RouteMessage
RouteMessage.getSource()
public void setApplicationId(java.lang.String app)
setApplicationId
in interface RouteMessage
app
- Application's identification who generates this message.RouteMessage.setApplicationId(java.lang.String)
public void setSource(NodeHandle handle)
setSource
in interface RouteMessage
handle
- The Node NodeHandle who sends this message through de ring.RouteMessage.setSource(planet.commonapi.NodeHandle)
public int getType()
getType
in interface RouteMessage
RouteMessage.getType()
public int getMode()
getMode
in interface RouteMessage
RouteMessage.getMode()
public java.lang.String getKey()
getKey
in interface RouteMessage
RouteMessage.getKey()
public void setType(int type)
setType
in interface RouteMessage
type
- Type of message.RouteMessage.setType(int)
public void setMode(int mode)
setMode
in interface RouteMessage
mode
- Mode of message.RouteMessage.setMode(int)
public void setKey(java.lang.String key)
setKey
in interface RouteMessage
key
- Identification key of this communication.RouteMessage.setKey(java.lang.String)
public void setOptions(java.lang.Object o)
setOptions
in interface RouteMessage
o
- additional options.public java.lang.Object getOptions()
getOptions
in interface RouteMessage
public void setNewNodeAlongRoute(NodeHandle node)
setNewNodeAlongRoute
in interface RouteMessage
node
- the new node to be added.public java.util.Collection getRoute()
getRoute
in interface RouteMessage
public void setRoute(java.util.Collection route) throws InitializationException
setRoute
in interface RouteMessage
route
- route from the source to the destination.
planet.commonapi.exception.InitializationException.
InitializationException
public void setTimeToLive(int ttl)
setTimeToLive
in interface RouteMessage
ttl
- time to live number.public int getTimeToLive()
getTimeToLive
in interface RouteMessage
public boolean routeMessagesHasExpired()
routeMessagesHasExpired
in interface RouteMessage
public void decTimeToLive()
decTimeToLive
in interface RouteMessage
public void setValues(java.lang.String appId, NodeHandle to, NodeHandle from, NodeHandle nh, Message msg, java.lang.String key, int type, int mode)
setValues
in interface RouteMessage
appId
- Identification of the Application which generate this
message.to
- Destination Id of this RouteMessage.from
- Source Id of this RouteMessage.nh
- NodeHandle for next hop.msg
- Message wrapped to this RouteMessage.key
- Identification key for this communication with the remote node.type
- Type of this message.mode
- Mode of this message.RouteMessage.setValues(java.lang.String, planet.commonapi.NodeHandle, planet.commonapi.NodeHandle, planet.commonapi.NodeHandle,
planet.commonapi.Message, java.lang.String, int, int)
public void inverse()
public java.lang.String toString()
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |