be.ac.ulg.montefiore.run.totem.trafficMatrix.facade
Class TrafficMatrixManagerObserver

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.TrafficMatrixManagerObserver
Direct Known Subclasses:
TrafficMatrixManager

public class TrafficMatrixManagerObserver
extends java.lang.Object

This class is used to notify all listeners of changes in the TrafficMatrixManager (i.e. trafficMatrix added, traffic matrix removed, change of default traffic matrix)

Creation date: 9 janv. 2006

Author:
Ga�l Monfort (monfort@run.montefiore.ulg.ac.be)
See Also:
TrafficMatrixManagerListener, TrafficMatrixManager

Constructor Summary
TrafficMatrixManagerObserver()
           
 
Method Summary
 void addListener(TrafficMatrixManagerListener l)
          Add a listener to the list of listeners.
 int getNbListeners()
          return the number of registered listeners
protected  void notifyAddTrafficMatrix(TrafficMatrix tm, int tmId)
          A TrafficMatrix has been loaded
protected  void notifyChangeDefaultTrafficMatrix(int asId, TrafficMatrix tm)
          The default traffic matrix has changed for the domain given by its asId.
protected  void notifyRemoveTrafficMatrix(TrafficMatrix tm, int tmId)
          A traffic matrix has been removed
 void removeListener(TrafficMatrixManagerListener l)
          Remove a listener from the list of registered listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrafficMatrixManagerObserver

public TrafficMatrixManagerObserver()
Method Detail

addListener

public void addListener(TrafficMatrixManagerListener l)
Add a listener to the list of listeners. This method does nothing if the listener is already registered.

Parameters:
l - the listener to add

removeListener

public void removeListener(TrafficMatrixManagerListener l)
Remove a listener from the list of registered listeners. This method has no effect if the listener is not registered.

Parameters:
l -

getNbListeners

public int getNbListeners()
return the number of registered listeners

Returns:

notifyAddTrafficMatrix

protected void notifyAddTrafficMatrix(TrafficMatrix tm,
                                      int tmId)
A TrafficMatrix has been loaded

Parameters:
tm - the new loaded traffic matrix
tmId - the new loaded traffic matrix id

notifyRemoveTrafficMatrix

protected void notifyRemoveTrafficMatrix(TrafficMatrix tm,
                                         int tmId)
A traffic matrix has been removed

Parameters:
tm - a reference to the removed traffic Matrix

notifyChangeDefaultTrafficMatrix

protected void notifyChangeDefaultTrafficMatrix(int asId,
                                                TrafficMatrix tm)
The default traffic matrix has changed for the domain given by its asId.

Parameters:
asId - Asid of the domain for which the traffic matrix has changed
tm - The new default traffic matrix for the domain


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