|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.totem.trafficMatrix.facade.TrafficMatrixManagerObserver
be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.TrafficMatrixManager
public class TrafficMatrixManager
The TrafficMatrixManager provides the access to all the traffic matrices. This class is a singleton and the single instance can be obtain using getInstance() method. All the methods here are related to intra-domain traffic matrices.
Creation date: 27-janv.-2005
Method Summary | |
---|---|
void |
addDomainEvent(Domain domain)
A new domain added. |
void |
addTrafficMatrix(TrafficMatrix tm,
int tmId)
Adds the traffic matrix tm with the TM ID tmId . |
void |
changeAsId(int oldASID,
int newASID)
|
void |
changeDefaultDomainEvent(Domain domain)
The default domain has changed for the specified domain. |
TrafficMatrix |
createEmptyTrafficMatrix(int asId)
Create a new traffic matrix with all values set to zero. |
TrafficMatrix |
createEmptyTrafficMatrix(int asId,
int tmId)
Create a new traffic matrix with all values set to zero. |
int |
generateTMID(int asId)
Generates a TM ID that can be used for the domain asId . |
void |
generateTrafficMatrix(int asId,
int tmId,
TrafficModel model,
double fraction)
Deprecated. Use TrafficGeneratorInterface and sub-classes instead and TrafficGeneratorFactory . |
TrafficMatrix |
generateTrafficMatrix(int asId,
int tmId,
TrafficModel model,
double fraction,
boolean generateOnlyEdgeTraffic)
Deprecated. Use TrafficGeneratorInterface and sub-classes instead and TrafficGeneratorFactory . |
TrafficMatrix |
getDefaultTrafficMatrix()
Returns the default traffic matrix for the default domain of InterDomainManager . |
TrafficMatrix |
getDefaultTrafficMatrix(int asId)
Returns the default traffic matrix for the domain asId . |
int |
getDefaultTrafficMatrixID()
Returns the TM ID of the default traffic matrix for the default domain of InterDomainManager . |
int |
getDefaultTrafficMatrixID(int asId)
Returns the TM ID of the default traffic matrix for the domain asId . |
static TrafficMatrixManager |
getInstance()
Returns the single instance of this class. |
java.util.List<java.lang.Integer> |
getTrafficMatrices(int asId)
Returns all the traffic matrices for a given domain asid |
TrafficMatrix |
getTrafficMatrix(int asId,
int tmId)
Returns the traffic matrix tmId for the domain asId . |
TrafficMatrix |
loadTrafficMatrix(java.io.File file,
int tmId,
boolean isDefaultTrafficMatrix)
Loads the intra-domain traffic matrix contained in the given file. |
TrafficMatrix |
loadTrafficMatrix(java.lang.String fileName)
Loads the intra-domain traffic matrix contained in the file fileName . |
TrafficMatrix |
loadTrafficMatrix(java.lang.String fileName,
int tmId,
boolean isDefaultTrafficMatrix)
Loads the intra-domain traffic matrix contained in the file fileName . |
void |
printAllRecordedTms()
|
void |
removeAllTrafficMatrices()
Removes all the traffic matrices from the TrafficMatrixManager .Warning: this method does not signal the listeners. |
void |
removeDefaultTrafficMatrix()
Removes the default traffic matrix of the default domain. |
void |
removeDefaultTrafficMatrix(int asId)
Removes the default traffic matrix of the domain asId . |
void |
removeDomainEvent(Domain domain)
A domain removed. |
void |
removeTrafficMatrices(int asId)
Removes all traffic matrices for the domain given by its asId |
void |
removeTrafficMatrix(int asId,
int tmId)
Removes the traffic matrix tmId of the domain asId . |
void |
saveTrafficMatrix(int asId,
int tmId,
java.lang.String fileName)
Saves the traffic matrix tmId of the domain asId to the file fileName . |
void |
setDefaultTrafficMatrix(int tmId)
Sets the traffic matrix tmId as default traffic matrix for
the default domain specified in InterDomainManager . |
void |
setDefaultTrafficMatrix(int asId,
int tmId)
Sets the traffic matrix tmId as default traffic matrix for
the domain asId . |
void |
updateTrafficMatrix(int tmId,
java.lang.String fileName)
Updates the intra-domain traffic matrix tmId with the information contained in the file fileName . |
Methods inherited from class be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.TrafficMatrixManagerObserver |
---|
addListener, getNbListeners, notifyAddTrafficMatrix, notifyChangeDefaultTrafficMatrix, notifyRemoveTrafficMatrix, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static TrafficMatrixManager getInstance()
public int getDefaultTrafficMatrixID() throws InvalidTrafficMatrixException
InterDomainManager
.
InterDomainManager
.
InvalidTrafficMatrixException
- If the default traffic matrix is not set for the default domain.public int getDefaultTrafficMatrixID(int asId) throws InvalidTrafficMatrixException
asId
.
asId
- The target domain.
asId
.
InvalidTrafficMatrixException
- If there is no default traffic matrix for the domain asId
.public TrafficMatrix getDefaultTrafficMatrix() throws InvalidTrafficMatrixException
InterDomainManager
.
InterDomainManager
.
InvalidTrafficMatrixException
- If the default traffic matrix is not set for the default domain.public java.util.List<java.lang.Integer> getTrafficMatrices(int asId)
asId
-
public TrafficMatrix getDefaultTrafficMatrix(int asId) throws InvalidTrafficMatrixException
asId
.
asId
- The AS ID of the target domain.
asId
.
InvalidTrafficMatrixException
- If the default traffic matrix is not set for the domain asId
.public TrafficMatrix getTrafficMatrix(int asId, int tmId) throws InvalidTrafficMatrixException
tmId
for the domain asId
.
asId
- The AS ID of the target domain.tmId
- The TM ID of the traffic matrix to return.
InvalidTrafficMatrixException
- If there is no traffic matrix tmId
for domain asId
.public void printAllRecordedTms()
public void setDefaultTrafficMatrix(int tmId) throws InvalidTrafficMatrixException
tmId
as default traffic matrix for
the default domain specified in InterDomainManager
.
tmId
- The TM ID of the default traffic matrix.
InvalidTrafficMatrixException
- If there is no traffic matrix tmId
for the default domain.public void setDefaultTrafficMatrix(int asId, int tmId) throws InvalidTrafficMatrixException
tmId
as default traffic matrix for
the domain asId
.
asId
- The AS ID of the target domain.tmId
- The TM ID of the default traffic matrix.
InvalidTrafficMatrixException
- If there is no traffic matrix tmId
for the domain asId
.public void addTrafficMatrix(TrafficMatrix tm, int tmId) throws TrafficMatrixAlreadyExistException, InvalidDomainException, TrafficMatrixIdException
tm
with the TM ID tmId
.
tm
- The traffic matrix to add.tmId
- The TM ID you wish to give to tm
.
TrafficMatrixAlreadyExistException
- If there is already a traffic matrix with the same TM ID for the same domain.
InvalidDomainException
- If the specified domain doesn't exist.
TrafficMatrixIdException
- If the traffic matrix id has already been set for the given matrix.public TrafficMatrix loadTrafficMatrix(java.lang.String fileName, int tmId, boolean isDefaultTrafficMatrix) throws TrafficMatrixAlreadyExistException, InvalidDomainException, NodeNotFoundException, InvalidTrafficMatrixException
fileName
.
fileName
- The name of the file containing the traffic matrix.tmId
- The TM ID you wish to give to the traffic matrix.isDefaultTrafficMatrix
- true
if the traffic matrix must be the default traffic matrix for its domain and false
otherwise.
TrafficMatrixAlreadyExistException
- If there is already a traffic matrix with the same TM ID for the same domain.
InvalidDomainException
- If the specified domain doesn't exist.
NodeNotFoundException
- If there is an unknown node in the traffic matrix.
InvalidTrafficMatrixException
- If the matrix is not valid (file does not exist, xml error,...)public TrafficMatrix loadTrafficMatrix(java.io.File file, int tmId, boolean isDefaultTrafficMatrix) throws TrafficMatrixAlreadyExistException, InvalidDomainException, NodeNotFoundException, InvalidTrafficMatrixException
file
- the file containing the traffic matrix.tmId
- The TM ID you wish to give to the traffic matrix.isDefaultTrafficMatrix
- true
if the traffic matrix must be the default traffic matrix for its domain and false
otherwise.
InvalidTrafficMatrixException
- If the matrix is not valid (file does not exist, xml error,...)
TrafficMatrixAlreadyExistException
- If there is already a traffic matrix with the same TM ID for the same domain.
InvalidDomainException
- If the specified domain doesn't exist.
NodeNotFoundException
- If there is an unknown node in the traffic matrix.public TrafficMatrix loadTrafficMatrix(java.lang.String fileName) throws InvalidDomainException, NodeNotFoundException, InvalidTrafficMatrixException
fileName
.
This method generates a TM ID and sets the traffic matrix as default
traffic matrix.
fileName
- The name of the file containing the traffic matrix.
InvalidTrafficMatrixException
- If the matrix is not valid (file does not exists, xml error,...)
InvalidDomainException
- If the specified domain doesn't exist.
NodeNotFoundException
- If there is an unknown node in the traffic matrix.public void saveTrafficMatrix(int asId, int tmId, java.lang.String fileName) throws InvalidTrafficMatrixException
tmId
of the domain asId
to the file fileName
.
asId
- The AS ID of the target domain.tmId
- The TM ID of the target traffic matrix.fileName
- The name of the target file.
InvalidTrafficMatrixException
- If there is no traffic matrix tmId
for the domain asId
.public void updateTrafficMatrix(int tmId, java.lang.String fileName) throws NodeNotFoundException, InvalidTrafficMatrixException
tmId
with the information contained in the file fileName
.
tmId
- The traffic matrix to update.fileName
- The name of the file containing the update information.
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.public void removeDefaultTrafficMatrix() throws InvalidTrafficMatrixException
InvalidTrafficMatrixException
- If there is no default traffic matrix for the default domain.public void removeDefaultTrafficMatrix(int asId) throws InvalidTrafficMatrixException
asId
.
asId
- The AS ID of the target domain.
InvalidTrafficMatrixException
- If there is no default traffic matrix for the domain asId
.public void removeTrafficMatrices(int asId)
asId
- public void removeTrafficMatrix(int asId, int tmId) throws InvalidTrafficMatrixException
tmId
of the domain asId
.
asId
- The AS ID of the target domain.tmId
- The TM ID of the target traffic matrix.
InvalidTrafficMatrixException
- If there is no traffic matrix tmId
for the domain asId
.public void removeAllTrafficMatrices()
TrafficMatrixManager
.
public TrafficMatrix createEmptyTrafficMatrix(int asId, int tmId) throws InvalidDomainException, TrafficMatrixAlreadyExistException
asId
- asid of the domain for which the matrix is to be createdtmId
- desired traffic matrix id
InvalidDomainException
- If the domain with given asid is not loaded
TrafficMatrixAlreadyExistException
- If a matrix with the same tmId already existspublic TrafficMatrix createEmptyTrafficMatrix(int asId) throws InvalidDomainException
asId
- asid of the domain for which the matrix is to be created
InvalidDomainException
- If the domain with given asid is not loadedpublic void generateTrafficMatrix(int asId, int tmId, TrafficModel model, double fraction) throws TrafficMatrixAlreadyExistException, InvalidDomainException, RoutingException, NoRouteToHostException, TrafficGenerationException
TrafficGeneratorInterface
and sub-classes instead and TrafficGeneratorFactory
.
tmId
for the domain asId
.
asId
- The target domain.tmId
- The TM ID that the new traffic matrix will have.model
- The model used to generate the matrix.fraction
- The fraction of the nodes that generate traffic.
TrafficMatrixAlreadyExistException
- If there is already a traffic matrix tmId
for the domain asId
.
InvalidDomainException
- If the domain asId
doesn't exist.
RoutingException
- If an error occurred during the routing process.
NoRouteToHostException
- If there is no route between a pair of nodes.
TrafficGenerationException
- If the generator didn't succeed in generating traffic with the required parameters.public TrafficMatrix generateTrafficMatrix(int asId, int tmId, TrafficModel model, double fraction, boolean generateOnlyEdgeTraffic) throws InvalidDomainException, TrafficMatrixAlreadyExistException, NoRouteToHostException, RoutingException
TrafficGeneratorInterface
and sub-classes instead and TrafficGeneratorFactory
.
tmId
for the domain asId
. (FSK)
asId
- The target domain.tmId
- The TM ID that the new traffic matrix will have.model
- The model used to generate the matrix.fraction
- The fraction of the nodes that generate traffic.generateOnlyEdgeTraffic
- true if the generator must only generate traffic for edge nodes
TrafficMatrixAlreadyExistException
- If there is already a traffic matrix tmId
for the domain asId
.
InvalidDomainException
- If the domain asId
doesn't exist.
RoutingException
- If an error occurred during the routing process.
NoRouteToHostException
- If there is no route between a pair of nodes.public int generateTMID(int asId) throws InvalidDomainException
asId
.
asId
- The target domain.
asId
.
InvalidDomainException
- If there is no domain asId
.public void addDomainEvent(Domain domain)
addDomainEvent
in interface InterDomainManagerListener
domain
- The new domain.public void removeDomainEvent(Domain domain)
removeDomainEvent
in interface InterDomainManagerListener
domain
- A reference to the domain removed.public void changeDefaultDomainEvent(Domain domain)
changeDefaultDomainEvent
in interface InterDomainManagerListener
domain
- the new default domain.public void changeAsId(int oldASID, int newASID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |