[jboss-svn-commits] JBL Code SVN: r8140 - labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Dec 8 09:30:36 EST 2006


Author: estebanschifman
Date: 2006-12-08 09:30:33 -0500 (Fri, 08 Dec 2006)
New Revision: 8140

Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
Log:
Add error directory/suffix/delete tags-accessors to FileEpr

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java	2006-12-08 14:28:11 UTC (rev 8139)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java	2006-12-08 14:30:33 UTC (rev 8140)
@@ -49,6 +49,9 @@
 	public static final String POST_DIR_TAG 	= "postDir";
 	public static final String POST_SUFFIX_TAG 	= "postSuffix";
 	public static final String POST_DEL_TAG 	= "postDelete";
+	public static final String ERROR_DIR_TAG 	= "errorDir";
+	public static final String ERROR_SUFFIX_TAG	= "errorSuffix";
+	public static final String ERROR_DEL_TAG 	= "errorDelete";
 	
 	public FileEpr (EPR epr)
 	{
@@ -234,6 +237,95 @@
 		return ("true".equals(getAddr().getExtensionValue(POST_DEL_TAG)));
 	}
 		
+	/**
+	 * Set the error directory for this EPR.
+	 * 
+	 * @param dir the directory to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setErrorDirectory (String dir) throws URISyntaxException
+	{
+		if (dir == null)
+			throw new IllegalArgumentException();
+		
+		if (errorDirSet)
+			throw new IllegalStateException("Cannot change error directory");
+		
+		getAddr().addExtension(ERROR_DIR_TAG, dir);
+		errorDirSet = true;
+	}
+	
+	/**
+	 * @return the error directory associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getErrorDirectory () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(ERROR_DIR_TAG);
+	}
+	
+	/**
+	 * Set the error suffix for this EPR.
+	 * 
+	 * @param suffix the suffix to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setErrorSuffix (String suffix) throws URISyntaxException
+	{
+		if (suffix == null)
+			throw new IllegalArgumentException();
+		
+		if (errorSuffixSet)
+			throw new IllegalStateException("Cannot change error suffix");
+		
+		getAddr().addExtension(ERROR_SUFFIX_TAG, suffix);
+		errorSuffixSet = true;
+	}
+	
+	/**
+	 * @return the error suffix associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getErrorSuffix () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(ERROR_SUFFIX_TAG);
+	}
+	
+	/**
+	 * Set the error delete for this EPR. (invalid Message files will be deleted)
+	 * 
+	 * @param del the deleted value to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setErrorDelete (boolean del) throws URISyntaxException
+	{		
+		if (errorDelSet)
+			throw new IllegalStateException("Cannot change error delete");
+		
+		if (del)
+			getAddr().addExtension(ERROR_DEL_TAG, "true");
+		else
+			getAddr().addExtension(ERROR_DEL_TAG, "false");
+		
+		errorDelSet = true;
+	}
+	
+	/**
+	 * Attention - Default 
+	 * @return the error delete value associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final boolean getErrorDelete () throws URISyntaxException
+	{
+		return (! "false".equals(getAddr().getExtensionValue(ERROR_DEL_TAG)));
+	}
+		
 	public static URI type ()
 	{
 	    return _type;
@@ -249,6 +341,9 @@
 	private boolean postDirSet = false;
 	private boolean postSuffixSet = false;
 	private boolean postDelSet = false;
+	private boolean errorDirSet = false;
+	private boolean errorSuffixSet = false;
+	private boolean errorDelSet = false;
 	
 	private static URI _type;
 	




More information about the jboss-svn-commits mailing list