be.ac.ulg.montefiore.run.totem.domain.model.impl
Class DomainValidatorImpl

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.model.impl.DomainValidatorImpl
All Implemented Interfaces:
DomainValidator

public class DomainValidatorImpl
extends java.lang.Object
implements DomainValidator

A DomainValidator can check and force some characteristics on a Domain

Creation date: 19-Jan-2005 18:40:51

Author:
Simon Balon (balon@run.montefiore.ulg.ac.be), Fabian Skivee (skivee@run.montefiore.ulg.ac.be)

Constructor Summary
DomainValidatorImpl(Domain domain)
           
 
Method Summary
 void forceConnected()
          Removes nodes and links that are not in the connected set of maximum size so that the graph is connected.
 void forceDuplexConnected()
          Checks that all the nodes of the topology have at least an outlink and an inlink.
 void forceIGPInfo()
          Adds the IGP information if not present.
 void forceLoopFree()
          This method removes all the loops present in the topology.
 void forceNoMultiGraph()
          Remove multiple links.
 java.util.List<java.util.List<Path>> getEqualCostMultiPath()
          Returns a list containing lists of paths.
 java.util.List<java.util.List<Path>> getEqualCostMultiPath(java.lang.String algo)
          Returns a list containing lists of paths.
 boolean isConnected()
          Checks if the graph is connected.
 boolean isDualConnected()
          Check if there exist at least two link coming into and going out of each node.
 boolean isDuplexConnected()
          Checks that all the nodes of the topology have at least an outlink and an inlink.
 boolean isEqualCostMultiPath()
          Check if there exists equal cost multi path in the topology
 boolean isIGPInfo()
          Verify if an IGP information section is present
 boolean isLoopFree()
          This method return true if the domain contains NO loop links.
 boolean isMultiGraph()
          Check if multiple links exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainValidatorImpl

public DomainValidatorImpl(Domain domain)
Method Detail

isIGPInfo

public boolean isIGPInfo()
Verify if an IGP information section is present

Specified by:
isIGPInfo in interface DomainValidator
Returns:
true if the section is present and false otherwise

isConnected

public boolean isConnected()
                    throws NodeNotFoundException
Checks if the graph is connected.

Specified by:
isConnected in interface DomainValidator
Returns:
true if the graph is connected and false if not.
Throws:
NodeNotFoundException

isLoopFree

public boolean isLoopFree()
                   throws NodeNotFoundException
This method return true if the domain contains NO loop links.

Specified by:
isLoopFree in interface DomainValidator
Throws:
NodeNotFoundException

isDuplexConnected

public boolean isDuplexConnected()
                          throws NodeNotFoundException,
                                 LinkNotFoundException
Checks that all the nodes of the topology have at least an outlink and an inlink. If it's not the case, it will add a link that is the "inverse" of an existing link. This method throws an IllegalArgumentException if the topology isn't connected.

Specified by:
isDuplexConnected in interface DomainValidator
Throws:
NodeNotFoundException
LinkNotFoundException

isDualConnected

public boolean isDualConnected()
                        throws NodeNotFoundException
Check if there exist at least two link coming into and going out of each node.

Specified by:
isDualConnected in interface DomainValidator
Returns:
true if there exist at least two link coming into and going out of each node and false otherwise
Throws:
NodeNotFoundException

isMultiGraph

public boolean isMultiGraph()
                     throws NodeNotFoundException
Check if multiple links exists

Specified by:
isMultiGraph in interface DomainValidator
Returns:
true if multiple links exists and false otherwise
Throws:
NodeNotFoundException

isEqualCostMultiPath

public boolean isEqualCostMultiPath()
                             throws NoRouteToHostException,
                                    RoutingException
Check if there exists equal cost multi path in the topology

Specified by:
isEqualCostMultiPath in interface DomainValidator
Returns:
true if there is equal cost multi path and false otherwise
Throws:
NoRouteToHostException
RoutingException

getEqualCostMultiPath

public java.util.List<java.util.List<Path>> getEqualCostMultiPath()
                                                           throws NoRouteToHostException,
                                                                  RoutingException
Description copied from interface: DomainValidator
Returns a list containing lists of paths. The inner list contains all equal cost paths from some source to some destination. Routing is done to thanks to the CSPF algorithm.

Specified by:
getEqualCostMultiPath in interface DomainValidator
Returns:
Throws:
NoRouteToHostException
RoutingException

getEqualCostMultiPath

public java.util.List<java.util.List<Path>> getEqualCostMultiPath(java.lang.String algo)
                                                           throws NoRouteToHostException,
                                                                  RoutingException,
                                                                  NoSuchAlgorithmException
Description copied from interface: DomainValidator
Returns a list containing lists of paths. The inner list contains all equal cost paths from some source to some destination. Routing is done to thanks to the specified algorithm.

Specified by:
getEqualCostMultiPath in interface DomainValidator
Returns:
Throws:
NoRouteToHostException
RoutingException
NoSuchAlgorithmException - If the given algorithm cannot be found.

forceIGPInfo

public void forceIGPInfo()
Adds the IGP information if not present. Create the IGP link if not present Create the static section if not present. If not define, the maximum bandwidth (mbw) and maximum reservable bandwidth (mrbw) are set to the link capacity and 155000 otherwise (VERY DANGEROUS). If not define, the metric (and TE metric) is the inverse of the capacity if present and 1 otherwise. Create the dynamic section if not present and set the value of the rbw for each priority to the maximum reservable bandwidth

Specified by:
forceIGPInfo in interface DomainValidator

forceConnected

public void forceConnected()
                    throws NodeNotFoundException,
                           LinkNotFoundException
Removes nodes and links that are not in the connected set of maximum size so that the graph is connected.

Specified by:
forceConnected in interface DomainValidator
Throws:
NodeNotFoundException
LinkNotFoundException

forceLoopFree

public void forceLoopFree()
                   throws NodeNotFoundException,
                          LinkNotFoundException
This method removes all the loops present in the topology. A loop is a link with the source node that is the same as the destination node.

Specified by:
forceLoopFree in interface DomainValidator
Throws:
NodeNotFoundException
LinkNotFoundException

forceDuplexConnected

public void forceDuplexConnected()
                          throws NodeNotFoundException,
                                 LinkNotFoundException,
                                 LinkAlreadyExistException
Checks that all the nodes of the topology have at least an outlink and an inlink. If it's not the case, it will add a link that is the "inverse" of an existing link. This method throws an IllegalArgumentException if the topology isn't connected.

Specified by:
forceDuplexConnected in interface DomainValidator
Throws:
NodeNotFoundException
LinkNotFoundException
LinkAlreadyExistException

forceNoMultiGraph

public void forceNoMultiGraph()
Remove multiple links. If the metric of the multiple links are equals, we merge the capacity of the two links. If not, we remove the link with the largest metric.

Specified by:
forceNoMultiGraph in interface DomainValidator


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.