|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.LinkLoadComputerManagerObserver be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.LinkLoadComputerManager
public class LinkLoadComputerManager
Maintain a set of LinkLoadComputer
corresponding to existing domains in
InterDomainManager
and existing traffic matrix in
TrafficMatrixManager
.
It contains a default computer which is the selected one. The manager sets a globally unique id for each LinkLoadComputer
it contains (via the LinkLoadComputer.setId(String)
call).
Creation date: 10 mars 2006
Method Summary | |
---|---|
void |
addDomainEvent(Domain domain)
A new domain added. |
LinkLoadComputer |
addLinkLoadComputer(Domain domain,
TrafficMatrix tm,
TmLoadComputer tlc)
Create a new LinkLoadComputer and add it to the manager with a generated id. |
LinkLoadComputer |
addLinkLoadComputer(Domain domain,
TrafficMatrix tm,
TmLoadComputer tlc,
boolean addAsDefault,
java.lang.String id)
Create a new LinkLoadComputer and add it to the manager with the id id |
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 |
void |
destroyLinkLoadComputers(Domain domain)
Destroys all the linkLoadComputer associated with domain, i.e. |
void |
destroyLinkLoadComputers(int asId,
int tmId)
Destroys all the linkLoadComputer associated with a given domain and a traffic matrix, i.e. |
java.lang.String |
generateId()
generate a globally unique string id |
java.lang.String |
generateId(java.lang.String prefix)
|
LinkLoadComputer |
getDefaultLinkLoadComputer(Domain domain)
returns the default LinkLoadComputer for the specified domain. |
static LinkLoadComputerManager |
getInstance()
|
LinkLoadComputer |
getLinkLoadComputer(java.lang.String id)
returns the linkLoadComputer with an id corresping to the given one. |
LinkLoadComputer |
getLinkLoadComputer(TrafficMatrix tm,
TmLoadComputer tlc)
returns the linkLoadComputer corresponding to the given traffic matrix and LinkLoadStrategy. |
java.util.List<LinkLoadComputer> |
getLinkLoadComputers(Domain domain)
returns a list of LinkLoadComputer for the given domain. |
java.util.List<LinkLoadComputer> |
getLinkLoadComputers(TrafficMatrix tm)
returns a list of LinkLoadComputer for the given trafficMatrix. |
void |
removeDomainEvent(Domain domain)
A domain removed. |
void |
removeLinkLoadComputer(LinkLoadComputer llc)
Remove a LinkLoadComputer from the manager. |
void |
removeTrafficMatrixEvent(TrafficMatrix tm,
int tmId)
A traffic matrix has been removed |
void |
setDefaultLinkLoadComputer(LinkLoadComputer llc)
Set a LinkLoadComputer as the default one. |
void |
setDefaultLinkLoadComputer(java.lang.String id)
Set the LinkLoadComputer identified by id 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()
public java.lang.String generateId(java.lang.String prefix)
public void destroy()
public LinkLoadComputer addLinkLoadComputer(Domain domain, TrafficMatrix tm, TmLoadComputer tlc, boolean addAsDefault, java.lang.String id) throws DataConsistencyException, LinkLoadComputerAlreadyExistsException
id and return it. If a
LinkLoadComputer that is equal (has same domain, tm and lls) exists in manager, no LinkLoadComputer will be created
and the LinkLoadComputer that is equal is returned (thus keeping its id).
- Parameters:
domain
- tm
- tlc
- addAsDefault
- Tell wether the new LinkLoadComputer should be the default one for its domain.id
- Id of the newly created LinkLoadComputer (ignored if a LinkLoadComputer with same parameters already exists in manager)
- Returns:
- The newly created LinkLoadComputer or a LinkLoadComputer that is already in manager and has the same set of parameters (domain, tm, lls).
- Throws:
DataConsistencyException
- If the tmId is not set for the trafficMatrix, or something is wrong with the parameters.
LinkLoadComputerAlreadyExistsException
- When a linkLoadComputer with the same id already exists in manager.
public LinkLoadComputer addLinkLoadComputer(Domain domain, TrafficMatrix tm, TmLoadComputer tlc) throws DataConsistencyException
domain
- tm
- tlc
-
DataConsistencyException
- If the tmId is not set for the trafficMatrix, or something is wrong with the parameters.public java.util.List<LinkLoadComputer> getLinkLoadComputers(Domain domain) throws InvalidLinkLoadComputerException
domain
-
InvalidLinkLoadComputerException
- if the domain is null.public java.util.List<LinkLoadComputer> getLinkLoadComputers(TrafficMatrix tm) throws InvalidLinkLoadComputerException
tm
-
InvalidLinkLoadComputerException
- if the traffic matrix is null or the traffic matrix is not in manager.public LinkLoadComputer getLinkLoadComputer(TrafficMatrix tm, TmLoadComputer tlc) throws InvalidLinkLoadComputerException
tm
- tlc
-
InvalidLinkLoadComputerException
- if traffic matrix or LinkLoadStrategy is null or the trafficMatrix is
not in manager, or no corresponding LinkLoadComputer exist in the manager.public LinkLoadComputer getDefaultLinkLoadComputer(Domain domain) throws InvalidLinkLoadComputerException
domain
-
InvalidLinkLoadComputerException
- If the domain is null or there is no default LinkLoadComputer for the given domain.public LinkLoadComputer getLinkLoadComputer(java.lang.String id) throws InvalidLinkLoadComputerException
id
-
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(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) throws DataConsistencyException
llc
-
DataConsistencyException
- if the trafficMatrix associated with llc is not in manager or if llc is not in
the manager.public void destroyLinkLoadComputers(Domain domain)
destroy()
for each of them.
domain
- public void destroyLinkLoadComputers(int asId, int tmId)
destroy()
for each of them.
asId
- The ASID of the domain.tmId
- The traffic Matrix 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 |