be.ac.ulg.montefiore.run.totem.domain.facade
Class InterDomainManager

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.facade.InterDomainManagerObserver
      extended by be.ac.ulg.montefiore.run.totem.domain.facade.InterDomainManager

public class InterDomainManager
extends InterDomainManagerObserver

The InterDomainManager provide the access to all the domains. This class is a singleton and the single instance can be obtain using getInstance() method.

Creation date: 12-Jan-2005 18:11:45

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be), Simon Balon (balon@run.montefiore.ulg.ac.be)

Method Summary
 void addDomain(Domain domain)
          Adds the domain domain to the InterDomainManager.
 SimplifiedDomain buildSimplifiedDomain(int ASID)
          Build a simplified topology of the ASID domain
 void changeAsId(int oldASID, int newASID)
           
 Domain[] getAllDomains()
           
 Domain getDefaultDomain()
          Return the default domain
 Domain getDomain(int ASID)
          Return the domain with ASID as autonomous system ID
static InterDomainManager getInstance()
          Get the single instance of the InterDomainManager.
 int getNbDomains()
           
 Domain loadDomain(java.io.InputStream is, boolean isDefaultDomain)
           
 Domain loadDomain(java.lang.String fileName, boolean isDefaultDomain, boolean removeMultipleLinks)
          Load a domain from a file
 Domain loadDomain(java.lang.String fileName, boolean isDefaultDomain, boolean removeMultipleLinks, boolean useBwSharing)
          Load a domain from a file
 Domain loadDomain(java.lang.String host, int port, boolean isDefaultDomain, boolean removeMultipleLinks, boolean useBwSharing)
          Load a domain from network.
 void removeAllDomains()
          Removes all the domains from the InterDomainManager.
 void removeDefaultDomain()
          Removes the default domain from the InterDomainManager.
 void removeDomain(int asId)
          Removes the domain asId from the InterDomainManager.
 void saveDomain(int ASID, java.lang.String fileName)
          Save the domain ASID in the specified file
 void setDefaultDomain(int ASID)
          Set the ASID domain as the default domain
 void uploadSimplifiedDomain(int ASID, SimplifiedDomain sDomain)
          Upload a simplified topology to the ASID domain.
 
Methods inherited from class be.ac.ulg.montefiore.run.totem.domain.facade.InterDomainManagerObserver
addListener, getNbListeners, notifyAddDomain, notifyChangeDefaultDomain, notifyRemoveDomain, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static InterDomainManager getInstance()
Get the single instance of the InterDomainManager.

Returns:

addDomain

public void addDomain(Domain domain)
               throws DomainAlreadyExistException
Adds the domain domain to the InterDomainManager.

Parameters:
domain - The Domain to add.
Throws:
DomainAlreadyExistException - If there is already a domain with the same AS ID as domain.

getDefaultDomain

public Domain getDefaultDomain()
Return the default domain

Returns:
the default domain

setDefaultDomain

public void setDefaultDomain(int ASID)
                      throws InvalidDomainException
Set the ASID domain as the default domain

Parameters:
ASID -
Throws:
InvalidDomainException - if the ASID domain is not loaded in the InterDomainManager

getDomain

public Domain getDomain(int ASID)
                 throws InvalidDomainException
Return the domain with ASID as autonomous system ID

Parameters:
ASID -
Returns:
the domain
Throws:
InvalidDomainException - if the ASID domain is not loaded in the InterDomainManager

loadDomain

public Domain loadDomain(java.lang.String host,
                         int port,
                         boolean isDefaultDomain,
                         boolean removeMultipleLinks,
                         boolean useBwSharing)
                  throws InvalidDomainException,
                         java.io.IOException,
                         DomainAlreadyExistException
Load a domain from network. The toolbox will act as a client, connects to a server on specified host and port and waits for the XML text correponding to the topology.

Parameters:
host -
port -
isDefaultDomain -
removeMultipleLinks -
useBwSharing -
Returns:
Throws:
InvalidDomainException
java.io.IOException
DomainAlreadyExistException

loadDomain

public Domain loadDomain(java.io.InputStream is,
                         boolean isDefaultDomain)
                  throws InvalidDomainException,
                         DomainAlreadyExistException
Throws:
InvalidDomainException
DomainAlreadyExistException

loadDomain

public Domain loadDomain(java.lang.String fileName,
                         boolean isDefaultDomain,
                         boolean removeMultipleLinks)
                  throws DomainAlreadyExistException,
                         InvalidDomainException
Load a domain from a file

Parameters:
fileName - the domain file name
isDefaultDomain - true if the domain must be the default domain and false otherwise
removeMultipleLinks - true if you want to remove the multiple links and false otherwise
Returns:
the loaded domain
Throws:
DomainAlreadyExistException - If there is already a domain with the same ASID.
InvalidDomainException - If the domain fails to initialize.

loadDomain

public Domain loadDomain(java.lang.String fileName,
                         boolean isDefaultDomain,
                         boolean removeMultipleLinks,
                         boolean useBwSharing)
                  throws DomainAlreadyExistException,
                         InvalidDomainException
Load a domain from a file

Parameters:
fileName - the domain file name
isDefaultDomain - true if the domain must be the default domain and false otherwise
removeMultipleLinks - true if you want to remove the multiple links and false otherwise
useBwSharing - true if you want to use BW sharing and false otherwise.
Returns:
the loaded domain
Throws:
DomainAlreadyExistException - If there is already a domain with the same ASID.
InvalidDomainException - If the domain fails to initialize.

saveDomain

public void saveDomain(int ASID,
                       java.lang.String fileName)
                throws InvalidDomainException
Save the domain ASID in the specified file

Parameters:
ASID - of the domain to save
fileName - in which saving the domain
Throws:
InvalidDomainException - if the ASID domain is not loaded in the InterDomainManager

buildSimplifiedDomain

public SimplifiedDomain buildSimplifiedDomain(int ASID)
                                       throws InvalidDomainException
Build a simplified topology of the ASID domain

Parameters:
ASID -
Returns:
the simplified topology
Throws:
InvalidDomainException - if the ASID domain is not loaded in the InterDomainManager

uploadSimplifiedDomain

public void uploadSimplifiedDomain(int ASID,
                                   SimplifiedDomain sDomain)
                            throws InvalidDomainException,
                                   SimplifiedDomainException
Upload a simplified topology to the ASID domain.

Parameters:
ASID - the ASID in which load the simplified topology
sDomain - the simplified topology
Throws:
InvalidDomainException
SimplifiedDomainException

removeDefaultDomain

public void removeDefaultDomain()
                         throws InvalidDomainException
Removes the default domain from the InterDomainManager.

Throws:
InvalidDomainException - If there is no default domain.

removeDomain

public void removeDomain(int asId)
                  throws InvalidDomainException
Removes the domain asId from the InterDomainManager. Also remove all change listeners of the domain.

Parameters:
asId - The domain to remove.
Throws:
InvalidDomainException - If there is no domain asId.

removeAllDomains

public void removeAllDomains()
Removes all the domains from the InterDomainManager. Also remove all change listeners of the domain. Warning: this method does not signal the listeners that domain are removed. Use with caution.


getAllDomains

public Domain[] getAllDomains()

getNbDomains

public int getNbDomains()

changeAsId

public void changeAsId(int oldASID,
                       int newASID)
                throws InvalidDomainException,
                       DomainAlreadyExistException
Throws:
InvalidDomainException
DomainAlreadyExistException


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