org.apache.torque.generator.configuration.outlet
Class OutletConfiguration

java.lang.Object
  extended by org.apache.torque.generator.configuration.outlet.OutletConfiguration

public class OutletConfiguration
extends Object

Administers the available Outlets.


Constructor Summary
OutletConfiguration(Collection<Outlet> outlets, Collection<MergepointMapping> mergepointMappings)
          Creates a OutletConfiguration containing a list of Outlets.
 
Method Summary
 void addOutlet(Outlet outlet)
          Adds a outlet.
 Outlet getOutlet(QualifiedName name)
          Returns the outlet with the name name.
 Map<QualifiedName,Outlet> getOutlets()
          Returns a map containing all the configured outlets, keyed by their name.
 boolean outletExists(QualifiedName qualifiedName)
          Returns whether a outlet for the given name exists.
 void resolveMergepointMappings()
          Resolves the isolated mergepoint mappings and adds them to the relevant outlets.
 String toString()
          Creates a String view of this object for debuggung purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutletConfiguration

public OutletConfiguration(Collection<Outlet> outlets,
                           Collection<MergepointMapping> mergepointMappings)
                    throws ConfigurationException
Creates a OutletConfiguration containing a list of Outlets.

Parameters:
outlets - the list of outlets, not null.
Throws:
ConfigurationException - if outlets contains two outlets with the same name.
NullPointerException - if outlets is null.
Method Detail

resolveMergepointMappings

public void resolveMergepointMappings()
                               throws ConfigurationException
Resolves the isolated mergepoint mappings and adds them to the relevant outlets.

Throws:
ConfigurationException

getOutlets

public Map<QualifiedName,Outlet> getOutlets()
Returns a map containing all the configured outlets, keyed by their name.

Returns:
all outlets, not null.
Throws:
IllegalStateException - if the mergepoint mappings have not yet been resolved.

getOutlet

public Outlet getOutlet(QualifiedName name)
Returns the outlet with the name name.

Parameters:
name - the name of the outlet to be returned.
Returns:
The outlet with the given name, or null if it does not exist.
Throws:
IllegalStateException - if the mergepoint mappings have not yet been resolved.

addOutlet

public void addOutlet(Outlet outlet)
               throws ConfigurationException
Adds a outlet.

Parameters:
outlet - the outlet to be added, not null.
Throws:
ConfigurationException - if a outlet with the outlet's name already exists in the configuration.
NullPointerException - if outlet is null.

toString

public String toString()
Creates a String view of this object for debuggung purposes.

Overrides:
toString in class Object
Returns:
a String view of this object, never null.
See Also:
Object.toString()

outletExists

public boolean outletExists(QualifiedName qualifiedName)
Returns whether a outlet for the given name exists. Name and namespace must match exactly.

Parameters:
qualifiedName - the name of the outlet.
Returns:
true if a outlet with the name exists, false otherwise.


Copyright © 2000-2012 The Apache Software Foundation. All Rights Reserved.