|
||||||||||
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.LinkLoadComputerManagerObserver
be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.LinkLoadComputerManager
public class LinkLoadComputerManager
Maintains a set of LinkLoadComputer
corresponding to
existing domains in InterDomainManager
and existing traffic
matrices in TrafficMatrixManager
.
It contains a default computer per domain which is the selected one. Each LinkLoadComputer is identified by a String id which is unique per domain.
The role of the LinkLoadComputerManager is three-fold:
Object.equals(Object)
methods.Creation date: 10 mars 2006
Method Summary | |
---|---|
void |
addDomainEvent(Domain domain)
A new domain added. |
java.lang.String |
addLinkLoadComputer(LinkLoadComputer llc)
Add the given LinkLoadComputer to the manager. |
void |
addLinkLoadComputer(LinkLoadComputer llc,
boolean addAsDefault,
java.lang.String id)
Adds a LinkLoadComputer to the manager and make it start listening to events by calling LinkLoadComputer.startListening() . |
void |
addTrafficMatrixEvent(TrafficMatrix tm,
int tmId)
A TrafficMatrix has been loaded |
void |
changeDefaultDomainEvent(Domain domain)
The default domain has changed for the specified domain. |
void |
changeDefaultTrafficMatrixEvent(int asId,
TrafficMatrix tm)
The default traffic matrix has changed for the domain given by its asId. |
void |
destroy()
remove listeners |
java.lang.String |
generateId(Domain domain)
Generates an unique string id for the specified domain. |
java.lang.String |
generateId(Domain domain,
java.lang.String prefix)
Generates an unused id for the specified domain, starting with the given prefix. |
LinkLoadComputer |
getDefaultLinkLoadComputer(Domain domain)
Returns the default LinkLoadComputer for the specified domain. |
java.lang.String |
getDefaultLinkLoadComputerId(Domain domain)
Returns the id of the default LinkLoadComputer of the given domain. |
static LinkLoadComputerManager |
getInstance()
Returns the unique instance, create it if necessary. |
LinkLoadComputer |
getLinkLoadComputer(Domain domain,
java.lang.String id)
Returns the LinkLoadComputer corresponding to the given id. |
Pair<java.lang.String,LinkLoadComputer> |
getLinkLoadComputer(LinkLoadComputer llc)
Returns a pair associating a LinkLoadComputer that is equal to the given one with its id in the manager. |
java.lang.String |
getLinkLoadComputerId(LinkLoadComputer llc)
Return the id associated with a LinkLoadComputer that is equal to the given one. |
java.util.Set<java.lang.String> |
getLinkLoadComputerIds(Domain domain)
Returns a set of all ids associated with the given domain |
java.util.Set<LinkLoadComputer> |
getLinkLoadComputers(Domain domain)
Returns a set of LinkLoadComputer for the given domain. |
java.util.Set<Pair<java.lang.String,LinkLoadComputer>> |
getLinkLoadComputersWithId(Domain domain)
Returns a set of all LinkLoadComputers of the given domain and their id. |
void |
removeDomainEvent(Domain domain)
A domain removed. |
void |
removeLinkLoadComputer(Domain domain,
java.lang.String id)
Remove a LinkLoadComputer corresponding to the given id from the manager and destroys it, after signaling the event LinkLoadComputerManagerObserver.notifyRemoveLinkLoadComputer(be.ac.ulg.montefiore.run.totem.trafficMatrix.model.LinkLoadComputer) . |
void |
removeLinkLoadComputer(LinkLoadComputer llc)
Remove a LinkLoadComputer that is equal to the given one from the manager and destroys it, after signaling the event LinkLoadComputerManagerObserver.notifyRemoveLinkLoadComputer(be.ac.ulg.montefiore.run.totem.trafficMatrix.model.LinkLoadComputer) . |
void |
removeTrafficMatrixEvent(TrafficMatrix tm,
int tmId)
A traffic matrix has been removed |
void |
setDefaultLinkLoadComputer(Domain domain,
java.lang.String id)
Sets the LinkLoadComputer identified by id as the default one. |
void |
setDefaultLinkLoadComputer(LinkLoadComputer llc)
Sets a LinkLoadComputer as the default one. |
Methods inherited from class be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.LinkLoadComputerManagerObserver |
---|
addListener, getNbListeners, notifyAddLinkLoadComputer, notifyChangeDefaultLinkLoadComputer, notifyRemoveLinkLoadComputer, notifyRemoveMultipleLinkLoadComputer, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static LinkLoadComputerManager getInstance()
public java.lang.String generateId(Domain domain)
public java.lang.String generateId(Domain domain, java.lang.String prefix)
domain
- prefix
-
public void destroy()
public void addLinkLoadComputer(LinkLoadComputer llc, boolean addAsDefault, java.lang.String id) throws LinkLoadComputerIdException, LinkLoadComputerAlreadyExistsException
LinkLoadComputer.startListening()
.
llc
- the LinkLoadComputeraddAsDefault
- Tells if it should be added as default for the LinkLoadComputer domainid
- Id to associate to the LinkLoadComputer
LinkLoadComputerIdException
- If a LinkLoadComputer with the same id already exists in the manager for the
same domain.
LinkLoadComputerAlreadyExistsException
- If a LinkLoadComputer that is equal to the given one already exists
in the manager.public java.lang.String addLinkLoadComputer(LinkLoadComputer llc) throws LinkLoadComputerAlreadyExistsException
LinkLoadComputer.startListening()
.
llc
-
LinkLoadComputerAlreadyExistsException
- If a LinkLoadComputer that is equal to the given one already existspublic java.util.Set<LinkLoadComputer> getLinkLoadComputers(Domain domain)
domain
-
public java.util.Set<Pair<java.lang.String,LinkLoadComputer>> getLinkLoadComputersWithId(Domain domain)
domain
-
public java.util.Set<java.lang.String> getLinkLoadComputerIds(Domain domain)
domain
-
public java.lang.String getLinkLoadComputerId(LinkLoadComputer llc) throws InvalidLinkLoadComputerException
llc
-
InvalidLinkLoadComputerException
- If no LinkLoadComputer equals to the given one can be found.public Pair<java.lang.String,LinkLoadComputer> getLinkLoadComputer(LinkLoadComputer llc) throws InvalidLinkLoadComputerException
llc
-
InvalidLinkLoadComputerException
- If no LinkLoadComputer equals to the given one can be found.public LinkLoadComputer getDefaultLinkLoadComputer(Domain domain) throws InvalidLinkLoadComputerException
domain
-
InvalidLinkLoadComputerException
- If there is no default LinkLoadComputer for the given domain.public java.lang.String getDefaultLinkLoadComputerId(Domain domain) throws InvalidLinkLoadComputerException
domain
-
InvalidLinkLoadComputerException
- If there is no default LinkLoadComputer for the given domain.public LinkLoadComputer getLinkLoadComputer(Domain domain, java.lang.String id) throws InvalidLinkLoadComputerException
id
- domain
-
InvalidLinkLoadComputerException
- if no LinkLoadComputers exists with this id.public void setDefaultLinkLoadComputer(LinkLoadComputer llc) throws InvalidLinkLoadComputerException
llc
-
InvalidLinkLoadComputerException
- if the linkLoadComputer cannot be found in the manager.public void setDefaultLinkLoadComputer(Domain domain, java.lang.String id) throws InvalidLinkLoadComputerException
id
as the default one.
id
-
InvalidLinkLoadComputerException
- If the LinkLoadComputer with id id
cannot be found in the manager.public void removeLinkLoadComputer(LinkLoadComputer llc)
LinkLoadComputerManagerObserver.notifyRemoveLinkLoadComputer(be.ac.ulg.montefiore.run.totem.trafficMatrix.model.LinkLoadComputer)
.
llc
- public void removeLinkLoadComputer(Domain domain, java.lang.String id)
LinkLoadComputerManagerObserver.notifyRemoveLinkLoadComputer(be.ac.ulg.montefiore.run.totem.trafficMatrix.model.LinkLoadComputer)
.
domain
- id
- public void addTrafficMatrixEvent(TrafficMatrix tm, int tmId)
TrafficMatrixManagerListener
addTrafficMatrixEvent
in interface TrafficMatrixManagerListener
tm
- the new loaded traffic matrixtmId
- the id of the newly loaded matrixpublic void removeTrafficMatrixEvent(TrafficMatrix tm, int tmId)
TrafficMatrixManagerListener
removeTrafficMatrixEvent
in interface TrafficMatrixManagerListener
tm
- a reference to the removed traffic Matrixpublic void changeDefaultTrafficMatrixEvent(int asId, TrafficMatrix tm)
TrafficMatrixManagerListener
changeDefaultTrafficMatrixEvent
in interface TrafficMatrixManagerListener
asId
- Asid of the domain for which the traffic matrix has changedtm
- The new default traffic matrix for the domainpublic void addDomainEvent(Domain domain)
InterDomainManagerListener
addDomainEvent
in interface InterDomainManagerListener
domain
- The new domain.public void removeDomainEvent(Domain domain)
InterDomainManagerListener
removeDomainEvent
in interface InterDomainManagerListener
domain
- A reference to the domain removed.public void changeDefaultDomainEvent(Domain domain)
InterDomainManagerListener
changeDefaultDomainEvent
in interface InterDomainManagerListener
domain
- the new default domain.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |