gov.nist.antd.merlin.util
Class BackupUtil

java.lang.Object
  |
  +--gov.nist.antd.merlin.util.BackupUtil

public class BackupUtil
extends java.lang.Object

This class contains some tools to call a backup path or route.

 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 BackupUtil()
          private constructor to avoid instantiation
 
Method Summary
private static void checkRouteCompatibility(OpticalConnection route, OpticalConnection repRoute)
          Check if the replacement can replace parts of the path.
static void filterRoute(OpticalConnection route)
          Filter the bundles if this route.
static OpticalConnection getBackupOfLink(int linkID, QualityOfService qos, Glass net)
          Call the backup of this link.
static OpticalConnection getBackupOfLink(OpticalConnection route, QualityOfService qos)
          Get the backup for this route.
static OpticalConnection getBackupOfLink(OpticalLink link, QualityOfService qos)
          Call the backup of this link.
static OpticalConnection getBackupOfRoute(int routeID, QualityOfService qos, Glass net)
          Get the backup for this route.
static OpticalConnection getBackupOfRoute(OpticalConnection route, QualityOfService qos)
          Get the backup for this route.
static void mergeRoutes(OpticalConnection route1, OpticalConnection route2)
          Merge two routes without merging their path but use the current path to get information
static void replaceSegment(OpticalConnection route, OpticalConnection repRoute)
          Replace a segment or a list of segments in the optical route.
static void restoreLink(OpticalConnection route, OpticalLink link, java.util.Vector backup)
          Update the possibles routes of the given OpticalConnection by changing the failed link by the backup links
static java.util.Vector[] restoreLink(java.util.Vector bundles, OpticalLink link, java.util.Vector backup)
          Update the possibles routes of the Vector of PtPBundle by changing the failed link by the backup links
(package private) static OpticalConnection runAlgorithms(OpticalConnection oRoute)
          Execute the algorithms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackupUtil

private BackupUtil()
private constructor to avoid instantiation

Method Detail

getBackupOfLink

public static OpticalConnection getBackupOfLink(int linkID,
                                                QualityOfService qos,
                                                Glass net)
Call the backup of this link. The algorithm must be for protection link.

Parameters:
linkID - The ID of the OpticalLink that failed.
qos - The Quality Of Service of the backup.
net - The OpNet that contains the link.
Returns:
The backup route or null if not found.

getBackupOfLink

public static OpticalConnection getBackupOfLink(OpticalLink link,
                                                QualityOfService qos)
Call the backup of this link. The algorithm must be for protection link.

Parameters:
link - The OpticalLink that failed.
qos - The Quality Of Service of the backup.
Returns:
The backup route or null if not found.

getBackupOfLink

public static OpticalConnection getBackupOfLink(OpticalConnection route,
                                                QualityOfService qos)
Get the backup for this route.

Parameters:
route - The OpticalConnection we want the backup
qos - The QualityOfService of the backup
Returns:
The backupRoute or null if not found.

getBackupOfRoute

public static OpticalConnection getBackupOfRoute(OpticalConnection route,
                                                 QualityOfService qos)
Get the backup for this route.

Parameters:
route - The OpticalConnection we want the backup
qos - The QualityOfService of the backup
Returns:
The backupRoute or null if not found.

getBackupOfRoute

public static OpticalConnection getBackupOfRoute(int routeID,
                                                 QualityOfService qos,
                                                 Glass net)
Get the backup for this route.

Parameters:
routeID - The ID of the OpticalConnection we want the backup.
qos - The QualityOfService of the backup.
net - The OpNet that contains the information.
Returns:
The backupRoute or null if not found.

runAlgorithms

static OpticalConnection runAlgorithms(OpticalConnection oRoute)
Execute the algorithms

Parameters:
oRoute - The OpticalConnection to backup
Returns:
The backup route or null if not found

replaceSegment

public static void replaceSegment(OpticalConnection route,
                                  OpticalConnection repRoute)
                           throws ReplacementException
Replace a segment or a list of segments in the optical route. This method reconfigurs the switching tables by using 0 ms of simulation time. While the replacing is in process the original path is locked. The replacement path need to have the same bandwidth.

Parameters:
route - Te route needs a section replaced
repRoute - The replacement route
Throws:
ReplacementException - The replacement could not made

checkRouteCompatibility

private static void checkRouteCompatibility(OpticalConnection route,
                                            OpticalConnection repRoute)
                                     throws ReplacementException
Check if the replacement can replace parts of the path. If the check is not successfull an exception will be thrown.

Parameters:
route - The original route.
repRoute - The replacement route.
Throws:
ReplacementException - Occurs if the check does not succeed.

restoreLink

public static void restoreLink(OpticalConnection route,
                               OpticalLink link,
                               java.util.Vector backup)
Update the possibles routes of the given OpticalConnection by changing the failed link by the backup links

Parameters:
route - The OpticalConnection to restore
link - The link which failed
backup - The Vector of links to use for backup

restoreLink

public static java.util.Vector[] restoreLink(java.util.Vector bundles,
                                             OpticalLink link,
                                             java.util.Vector backup)
Update the possibles routes of the Vector of PtPBundle by changing the failed link by the backup links

Parameters:
bundles - The list of links that must replace the given link.
link - The link which failed
backup - The Vector of links to use for backup
Returns:
the Array of new Vector of PtPBundle

mergeRoutes

public static void mergeRoutes(OpticalConnection route1,
                               OpticalConnection route2)
Merge two routes without merging their path but use the current path to get information

Parameters:
route1 - The original route
route2 - The route to integrate

filterRoute

public static void filterRoute(OpticalConnection route)
Filter the bundles if this route. Consider only one link per bundle

Parameters:
route - The OpticalConnection that must be filtered