org.jboss.soa.esb.addressing.util
Class EPRManager

java.lang.Object
  extended by org.jboss.soa.esb.addressing.util.EPRManager

public class EPRManager
extends java.lang.Object

Allows EPRs to be saved to and loaded from files. Mainly for testing purposes. This version assumes XML as the output format.

Author:
marklittle

Constructor Summary
protected EPRManager(java.lang.String domain)
           
 
Method Summary
 boolean equals(java.lang.Object manager)
           
 java.lang.String getDomain()
           
static EPRManager getInstance()
          All EPRs are saves in files within the current working directory.
static EPRManager getInstance(java.lang.String domain)
          All EPRs are saves in files within a defined directory.
 int hashCode()
          Return a hash code for this element.
 EPR loadEPR(java.lang.String name)
          Get the EPR specified by the logical name.
 void removeEPR(java.lang.String name)
          Remove the EPR-to-file association.
 void saveEPR(java.lang.String name, EPR address)
          Save the EPR into the specified file.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPRManager

protected EPRManager(java.lang.String domain)
Method Detail

getInstance

public static final EPRManager getInstance()
All EPRs are saves in files within the current working directory.

Returns:
the manager for the cwd.

getInstance

public static final EPRManager getInstance(java.lang.String domain)
All EPRs are saves in files within a defined directory. Get the right manager for that directory.

Parameters:
domain - the name of the directory. If null then the null String is assumed.
Returns:
the manager for the directory. If it does not exist, then one will be created.

getDomain

public final java.lang.String getDomain()

equals

public boolean equals(java.lang.Object manager)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Return a hash code for this element.

Overrides:
hashCode in class java.lang.Object
Returns:
the element hash code.

saveEPR

public final void saveEPR(java.lang.String name,
                          EPR address)
                   throws java.io.IOException
Save the EPR into the specified file.

Parameters:
name - the name of the file to use (the logical service name).
address - the EPR to save.
Throws:
java.io.IOException - thrown if there is an error.

removeEPR

public final void removeEPR(java.lang.String name)
                     throws java.io.IOException
Remove the EPR-to-file association.

Parameters:
name - the logical name for the service.
Throws:
java.io.IOException - thrown if there are any errors.

loadEPR

public final EPR loadEPR(java.lang.String name)
                  throws java.io.IOException
Get the EPR specified by the logical name.

Parameters:
name - the service name.
Returns:
the EPR, or null if none exists.
Throws:
java.io.IOException - thrown if there is an error.