be.ac.ulg.montefiore.run.totem.trafficMatrix.persistence
Class TrafficMatrixFactory

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.trafficMatrix.persistence.TrafficMatrixFactory

public class TrafficMatrixFactory
extends java.lang.Object

Factory to load and save traffic matrices.

Creation date: 28-janv.-2005

Author:
Jean Lepropre (lepropre@run.montefiore.ulg.ac.be), Olivier Delcourt (delcourt@run.montefiore.ulg.ac.be)

Constructor Summary
TrafficMatrixFactory()
           
 
Method Summary
static TrafficMatrixFileType loadInterDomainMatrix(java.lang.String netflowXMLTrafficMatrixFileName)
          Load an inter Domain traffic matrix
static TrafficMatrix loadTrafficMatrix(java.io.File file)
          Returns the intra-domain traffic matrix contained in the given file file.
static TrafficMatrix loadTrafficMatrix(java.lang.String fileName)
          Returns the intra-domain traffic matrix contained in the file fileName.
static void saveTrafficMatrix(java.lang.String fileName, TrafficMatrix tm)
          Saves the intra-domain traffic matrix tm to the file fileName.
static void updateTrafficMatrix(java.lang.String fileName, int tmId)
          Updates the intra-domain traffic matrix tmId with the information contained in the file fileName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrafficMatrixFactory

public TrafficMatrixFactory()
Method Detail

loadTrafficMatrix

public static TrafficMatrix loadTrafficMatrix(java.lang.String fileName)
                                       throws InvalidDomainException,
                                              NodeNotFoundException,
                                              InvalidTrafficMatrixException
Returns the intra-domain traffic matrix contained in the file fileName.

Parameters:
fileName - The name of the file containing the intra-domain traffic matrix.
Returns:
The traffic matrix contained in the file fileName.
Throws:
InvalidTrafficMatrixException - If the matrix cannot be loaded (error in XML).
InvalidDomainException - If there is no domain corresponding to the traffic matrix.
NodeNotFoundException - If there is an unknown node in the traffic matrix.

loadTrafficMatrix

public static TrafficMatrix loadTrafficMatrix(java.io.File file)
                                       throws InvalidTrafficMatrixException,
                                              InvalidDomainException,
                                              NodeNotFoundException
Returns the intra-domain traffic matrix contained in the given file file.

Parameters:
file - the file containing the intra-domain traffic matrix.
Returns:
The traffic matrix contained in the file fileName.
Throws:
InvalidTrafficMatrixException - If the matrix cannot be loaded (error in XML).
InvalidDomainException - If there is no domain corresponding to the traffic matrix.
NodeNotFoundException - If there is an unknown node in the traffic matrix.

saveTrafficMatrix

public static void saveTrafficMatrix(java.lang.String fileName,
                                     TrafficMatrix tm)
                              throws InvalidDomainException,
                                     NodeNotFoundException
Saves the intra-domain traffic matrix tm to the file fileName.

Parameters:
fileName - The name of the target file.
tm - The traffic matrix to save.
Throws:
InvalidDomainException - If there is no domain corresponding to tm.
NodeNotFoundException - If there is an unknown node in the traffic matrix.

updateTrafficMatrix

public static void updateTrafficMatrix(java.lang.String fileName,
                                       int tmId)
                                throws NodeNotFoundException,
                                       InvalidTrafficMatrixException
Updates the intra-domain traffic matrix tmId with the information contained in the file fileName.

Parameters:
fileName - The name of the file containing the update information.
tmId - The TM ID of the traffic matrix to update.
Throws:
InvalidTrafficMatrixException - If the traffic matrix to update can't be retrieved.
NodeNotFoundException - If the information contained in the file is not consistent with the traffic matrix to update.

loadInterDomainMatrix

public static TrafficMatrixFileType loadInterDomainMatrix(java.lang.String netflowXMLTrafficMatrixFileName)
                                                   throws InvalidTrafficMatrixException,
                                                          javax.xml.bind.JAXBException
Load an inter Domain traffic matrix

Parameters:
netflowXMLTrafficMatrixFileName -
Returns:
Throws:
InvalidTrafficMatrixException - If the matrix is not an inter domain one
javax.xml.bind.JAXBException - if JAXB cannot load the matrix


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