be.ac.ulg.montefiore.run.totem.domain.persistence
Class DomainFactory

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.persistence.DomainFactory

public class DomainFactory
extends java.lang.Object

Factory for loading and saving domain

Creation date: 12-Jan-2005 18:10:16

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be), Jean Lepropre (lepropre@run.montefiore.ulg.ac.be)

Field Summary
static int DEFAULT_PORT
           
 
Constructor Summary
DomainFactory()
           
 
Method Summary
static Domain loadDistantDomain(java.lang.String host, boolean removeMultipleLink, boolean useBwSharing)
           
static Domain loadDistantDomain(java.lang.String host, int port)
           
static Domain loadDistantDomain(java.lang.String host, int port, boolean removeMultipleLink, boolean useBwSharing)
           
static Domain loadDomain(java.io.InputStream is)
           
static Domain loadDomain(java.io.InputStream is, boolean removeMultipleLink, boolean useBwSharing)
           
static Domain loadDomain(java.lang.String fileName)
          Load a domain from a file not removing multiple links nor using BwSharing
static Domain loadDomain(java.lang.String fileName, boolean removeMultipleLink, boolean useBwSharing)
          Load a domain from a file
static void saveDomain(java.lang.String fileName, Domain domain)
          Save a domain to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

DomainFactory

public DomainFactory()
Method Detail

loadDistantDomain

public static Domain loadDistantDomain(java.lang.String host,
                                       boolean removeMultipleLink,
                                       boolean useBwSharing)
                                throws java.io.IOException,
                                       InvalidDomainException
Throws:
java.io.IOException
InvalidDomainException

loadDistantDomain

public static Domain loadDistantDomain(java.lang.String host,
                                       int port,
                                       boolean removeMultipleLink,
                                       boolean useBwSharing)
                                throws java.io.IOException,
                                       InvalidDomainException
Throws:
java.io.IOException
InvalidDomainException

loadDistantDomain

public static Domain loadDistantDomain(java.lang.String host,
                                       int port)
                                throws java.io.IOException,
                                       InvalidDomainException
Throws:
java.io.IOException
InvalidDomainException

loadDomain

public static Domain loadDomain(java.io.InputStream is)
                         throws InvalidDomainException
Throws:
InvalidDomainException

loadDomain

public static Domain loadDomain(java.lang.String fileName)
                         throws InvalidDomainException,
                                java.io.FileNotFoundException
Load a domain from a file not removing multiple links nor using BwSharing

Parameters:
fileName - file name of the domain
Returns:
the loaded domain
Throws:
InvalidDomainException - If the domain fails to initialize
java.io.FileNotFoundException - If the given file is not found

loadDomain

public static Domain loadDomain(java.lang.String fileName,
                                boolean removeMultipleLink,
                                boolean useBwSharing)
                         throws InvalidDomainException,
                                java.io.FileNotFoundException
Load a domain from a file

Parameters:
fileName - file name of the domain
removeMultipleLink -
useBwSharing -
Returns:
the loaded domain
Throws:
InvalidDomainException - If the domain fails to initialize
java.io.FileNotFoundException - If the given file is not found

loadDomain

public static Domain loadDomain(java.io.InputStream is,
                                boolean removeMultipleLink,
                                boolean useBwSharing)
                         throws InvalidDomainException
Throws:
InvalidDomainException

saveDomain

public static void saveDomain(java.lang.String fileName,
                              Domain domain)
Save a domain to a file

Parameters:
fileName - file name in which saving the domain
domain - the domain to save


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