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

Constructor Index

 o VirtualNet(String)
 o VirtualNet(String, long)

Method Index

 o 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
 o destroy()
This is the destructor: detsroy the NetLayout and unbinds the VirtualNetRemote
 o getName()
Gives the name of the net
 o isValidVNName(String)
Checks if a name is a valid virtual name.
 o update(Observable, Object)
Observable method

Constructors

 o VirtualNet
 public VirtualNet(String name) throws VNRemoteException
Parameters:
name - The name of the virtualNet
Throws: VNRemoteException
if the name is not valid
 o 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

Methods

 o 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
 o getName
 public String getName()
Gives the name of the net

Returns:
the name of the virtual net
 o 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
 o update
 public void update(Observable o,
                    Object arg)
Observable method

Overrides:
update in class NetLayout
 o 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