gov.nist.antd.optical.util
Class NodeUtil

java.lang.Object
  |
  +--gov.nist.antd.optical.util.NodeUtil

public class NodeUtil
extends java.lang.Object

This class contains tools for Node objects.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Constructor Summary
private NodeUtil()
          Private constructor to avoid instantiation
 
Method Summary
static Fiber getFiber(Host node, int onicID, int fiberID)
          Get the fiber according to the given interface, fiber ID in the node.
static Lambda getLambda(Host node, int onicID, int fiberID, int lambdaID)
          Get the lambda according to the given interface, fiber and lambda ID in the node.
static OpticalLink getLink(Host node, int onicID)
          Identifier list of fibers for the given ONIC.
static ONIC getONIC(Host node, Fiber fiber)
          Find an ONIC from a fiber inside it.
static ONIC getONIC(Host node, int onicID)
          Find an ONIC from its ID
static ONIC getONIC(Host node, Lambda lambda)
          Find an ONIC from a lambda inside it.
static ONIC getONICfromIP(Host node, int onicIP)
          Find an ONIC from its IP adress in the given node
static ONIC getONICofPort(Host node, int port)
          Find the ONIC that use the given fiber
static java.util.Vector getONICs(Host node)
          Return the ONICs of the given node.
static java.util.Vector getOpticalLinks(ExtRouter forNode)
          Get the vector of optical links that connect two the given node.
static java.util.Vector getOpticalLinks(ExtRouter node1, ExtRouter node2)
          Get the vector of optical links that connect two nodes This method does not care about the direction of the fibers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeUtil

private NodeUtil()
Private constructor to avoid instantiation

Method Detail

getOpticalLinks

public static java.util.Vector getOpticalLinks(ExtRouter node1,
                                               ExtRouter node2)
Get the vector of optical links that connect two nodes This method does not care about the direction of the fibers

Parameters:
node1 - The first node
node2 - The second node
Returns:
The vector of links that connect the two given nodes

getOpticalLinks

public static java.util.Vector getOpticalLinks(ExtRouter forNode)
Get the vector of optical links that connect two the given node. This method does not care about the direction of the fibers

Parameters:
forNode - The given optical node
Returns:
The vector of links that connect the given node

getONIC

public static ONIC getONIC(Host node,
                           int onicID)
Find an ONIC from its ID

Parameters:
node - The node that should contain the ONIC
onicID - The id of the ONIC.
Returns:
The ONIC or null if it doesn't exist.

getONICfromIP

public static ONIC getONICfromIP(Host node,
                                 int onicIP)
Find an ONIC from its IP adress in the given node

Parameters:
node - The node that should contain the ONIC
onicIP - The ip of the ONIC.
Returns:
The ONIC or null if it doesn't exist.

getONICofPort

public static ONIC getONICofPort(Host node,
                                 int port)
Find the ONIC that use the given fiber

Parameters:
node - The node that should contain the ONIC
port - the port ID.
Returns:
The ONIC or null if it doesn't exist.

getONIC

public static ONIC getONIC(Host node,
                           Lambda lambda)
Find an ONIC from a lambda inside it.

Parameters:
node - The node that should contain the ONIC
lambda - The lambda attached to the ONIC
Returns:
The ONIC or null if it doesn't exist.

getONIC

public static ONIC getONIC(Host node,
                           Fiber fiber)
Find an ONIC from a fiber inside it.

Parameters:
node - The node that should contain the ONIC
fiber - The fiber attached to the ONIC
Returns:
The ONIC or null if it doesn't exist.

getLink

public static OpticalLink getLink(Host node,
                                  int onicID)
Identifier list of fibers for the given ONIC.

Parameters:
node - The node that should contain the ONIC
onicID - The id of the ONIC.
Returns:
fiber id list.

getONICs

public static java.util.Vector getONICs(Host node)
Return the ONICs of the given node.

Parameters:
node - The node we want to have the ONICs
Returns:
The vector of ONICs

getLambda

public static Lambda getLambda(Host node,
                               int onicID,
                               int fiberID,
                               int lambdaID)
Get the lambda according to the given interface, fiber and lambda ID in the node.

Parameters:
node - The host that contains the ONIC
onicID - The ID of the interface connected to the fiber
fiberID - The fiber that contains the lambda
lambdaID - The ID of the lambda
Returns:
The lambda or null if one of the parameter is invalid.

getFiber

public static Fiber getFiber(Host node,
                             int onicID,
                             int fiberID)
Get the fiber according to the given interface, fiber ID in the node.

Parameters:
node - The host that contains the ONIC
onicID - The ID of the interface connected to the fiber
fiberID - The fiber that contains the lambda
Returns:
The fiber or null if one of the parameter is invalid.