All Packages Class Hierarchy This Package Previous Next Index
Class vnet.remote.VirtualNet
java.lang.Object
|
+----java.util.Observable
|
+----vnet.NetLayout
|
+----vnet.remote.VirtualNet
- public class VirtualNet
- extends NetLayout
Class that represents a NetLayout remote
This remote Netlayout creates a Host for each node in the net, in order
to allow to clients and servers to get attached to the nodes (the machines).
Because several VirtualNets can bur running at the same time, they are
differenciated by a name, that must ve valid (only letters).
- Version:
- 0.1, august-1997
- Author:
- LuisM Pena
- See Also:
- NetLayout
-
VirtualNet(String)
-
-
VirtualNet(String, long)
-
-
addNode(NodeId, long)
- Inserts a new node in the net, with the specified delay
The observers of the netlayout will receive a VirtualNetEvent notification,
with the new node inside
-
destroy()
- This is the destructor: detsroy the NetLayout and unbinds the VirtualNetRemote
-
getName()
- Gives the name of the net
-
isValidVNName(String)
- Checks if a name is a valid virtual name.
-
update(Observable, Object)
- Observable method
VirtualNet
public VirtualNet(String name) throws VNRemoteException
- Parameters:
- name - The name of the virtualNet
- Throws: VNRemoteException
- if the name is not valid
VirtualNet
public VirtualNet(String name,
long delay) throws VNRemoteException
- Parameters:
- name - The name of the virtualNet
- delay - the delay that will apply by default to the nodes and links
- Throws: VNRemoteException
- if the name is not valid
destroy
public void destroy() throws VNException
- This is the destructor: detsroy the NetLayout and unbinds the VirtualNetRemote
- Throws: VNException
- if any NetNode.destroy() fails
- Overrides:
- destroy in class NetLayout
- See Also:
- destroy
getName
public String getName()
- Gives the name of the net
- Returns:
- the name of the virtual net
addNode
public void addNode(NodeId id,
long Delay) throws VNException, VNRemoteException
- Inserts a new node in the net, with the specified delay
The observers of the netlayout will receive a VirtualNetEvent notification,
with the new node inside
- Parameters:
- id - the Node identity
- Throws: VNException
- if the NodeId has already been added to the net
- Throws: VNRemoteException
- if the new Node can not be binded in the rmiregistry
- Overrides:
- addNode in class NetLayout
update
public void update(Observable o,
Object arg)
- Observable method
- Overrides:
- update in class NetLayout
isValidVNName
public static boolean isValidVNName(String name)
- Checks if a name is a valid virtual name.
A valid VirtualNet Name is those with only letters, and having
at least one letter
- Parameters:
- name - the name to check
- Returns:
- true if the name is valid
All Packages Class Hierarchy This Package Previous Next Index