All Packages Class Hierarchy This Package Previous Next Index
Class vnet.NetLink
java.lang.Object
|
+----java.util.Observable
|
+----vnet.NetLink
- public class NetLink
- extends Observable
Class to represent a link in the net.
In this simulation, a link is any communication channel beetween two nodes
in the net, that can be break down at any moment. If a node is fail down,
all its links are also considered to fail.
It implements the Observable function of the observer pattern.
- Version:
- 0.1, august-1997
- Author:
- LuisM Pena
-
NetLink(LinkId, NetNode, NetNode, long)
-
-
destroy()
- Destructor of the link: notifies it to the nodes associated to the link
The observers of the node will receive a LinkDestroyedEvent notification
The list of observers is cleared
-
getId()
- Returns the identity of the Link
-
getNodeA()
- Returns the first of the nodes associated to the link
-
getNodeB()
- Returns the second node associated to the link
NetLink
public NetLink(LinkId id,
NetNode nodeA,
NetNode nodeB,
long delay) throws VNException
- Parameters:
- id - the identity of the link
- nodeA - any of the two nodes associated to this link
- nodeB - the another node
- delay - the delay involving any operation on this link
- Throws: VNException
- if any of the nodes fails in the operation addLink
- See Also:
- addLink
getId
public LinkId getId()
- Returns the identity of the Link
- Returns:
- The identity of the link
getNodeA
public NetNode getNodeA()
- Returns the first of the nodes associated to the link
- Returns:
- The first of the nodes associated
getNodeB
public NetNode getNodeB()
- Returns the second node associated to the link
- Returns:
- The second node associated to the link
destroy
public void destroy() throws VNException
- Destructor of the link: notifies it to the nodes associated to the link
The observers of the node will receive a LinkDestroyedEvent notification
The list of observers is cleared
- Throws: VNException
- if any of the nodes associated fails during the
removeLink operation
- See Also:
- removeLink, LinkDestroyedEvent
All Packages Class Hierarchy This Package Previous Next Index