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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Oct 1 17:04:09 EDT 2006


Author: mark.little at jboss.com
Date: 2006-10-01 17:04:06 -0400 (Sun, 01 Oct 2006)
New Revision: 6510

Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
Log:
Updated javadocs.

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java	2006-10-01 10:55:48 UTC (rev 6509)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java	2006-10-01 21:04:06 UTC (rev 6510)
@@ -21,97 +21,207 @@
  * @author mark.little at jboss.com
  */
 
+import java.net.URI;
+import java.net.URISyntaxException;
 
 /**
+ * Represents an interaction pattern for a specific message exchange. When sending a message
+ * the sender application can specify where errors are to be returned, where responses are
+ * to go, along with other interaction information.
+ * 
  * A call represents an exchange pattern for this message. It is built up as the message
  * flows through the ESB and identifies where the message should go, along with any
  * routing information for faults, replies etc.
+ *
+ * 
+ * To: the destination. MANDATORY.
+ * From: the sender. OPTIONAL. If not defined, then the sender MAY be inferred from the transport.
+ * ReplyTo: the destination for any response. OPTIONAL.
+ * FaultTo: the destination for any error message. OPTIONAL.
+ * RelatesTo: used to indicate that this message is related to another. OPTIONAL.
+ * Action: used by the sender to indicate the semantics of the message. Must be unique. MANDATORY.
+ * MessageID: used to uniquely identify this message. OPTIONAL.
+ * 
+ * @author marklittle
+ *
  */
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 public class Call
 {
+	/**
+	 * Create a new (empty) call.
+	 */
+	
 	public Call ()
 	{
 	}
 	
+	/**
+	 * Create a new call, whose To field is set to the supplied EPR.
+	 * 
+	 * @param epr the To field.
+	 */
+	
 	public Call (EPR epr)
 	{
 		_to = epr;
 	}
 	
+	/**
+	 * Set the To field. Must not be null.
+	 * 
+	 * @param epr the To field value.
+	 */
+	
 	public void setTo (EPR epr)
 	{
+		if (epr == null)
+			throw new IllegalArgumentException();
+		
 		_to = epr;
 	}
 	
+	/**
+	 * @return the To field.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
 	public EPR getTo () throws URISyntaxException
 	{
 		return _to;
 	}
 	
+	/**
+	 * Set the From field. May be null.
+	 * 
+	 * @param from the value of the field.
+	 */
+	
 	public void setFrom (EPR from)
 	{
 		_from = from;
 	}
 	
+	/**
+	 * @return the From field.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
 	public EPR getFrom () throws URISyntaxException
 	{
 		return _from;
 	}
 	
+	/**
+	 * Set the ReplyTo field. May be null.
+	 * 
+	 * @param replyTo the value of the field.
+	 */
+	
 	public void setReplyTo (EPR replyTo)
 	{
 		_replyTo = replyTo;
 	}
 	
+	/**
+	 * @return the ReplyTo field.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
 	public EPR getReplyTo () throws URISyntaxException
 	{
 		return _replyTo;
 	}
 	
+	/**
+	 * Set the FaultTo field. May be null.
+	 * 
+	 * @param uri the value of the field.
+	 */
+	
 	public void setFaultTo (EPR uri)
 	{
 		_faultTo = uri;
 	}
 	
+	/**
+	 * @return the FaultTo field.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
 	public EPR getFaultTo () throws URISyntaxException
 	{
 		return _faultTo;
 	}
 	
+	/**
+	 * Set the RelatesTo field.
+	 * 
+	 * @param uri the value to set.
+	 */
+	
 	public void setRelatesTo (URI uri)
 	{
 		_relatesTo = uri;
 	}
 	
+	/**
+	 * @return the RelatesTo field.
+	 * @throws URISyntaxException thrown if the field is invalid.
+	 */
+	
 	public URI getRelatesTo () throws URISyntaxException
 	{
 		return _relatesTo;
 	}
 	
+	/**
+	 * Set the Action field.
+	 * @param uri the value to set.
+	 */
+	
 	public void setAction (URI uri)
 	{
 		_action = uri;
 	}
 
+	/**
+	 * @return the Action field.
+	 * @throws URISyntaxException thrown if the field is invalid.
+	 */
+	
 	public URI getAction () throws URISyntaxException
 	{
 		return _action;
 	}
 	
+	/**
+	 * Set the MessageId for this instance.
+	 * 
+	 * @param uri the value to use.
+	 */
+	
 	public void setMessageID (URI uri)
 	{
 		_messageID = uri;
 	}
 	
+	/**
+	 * @return the MessageID field.
+	 * @throws URISyntaxException thrown if the value is invalid.
+	 */
+	
 	public URI getMessageID () throws URISyntaxException
 	{
 		return _messageID;
 	}
 	
+	/**
+	 * Copy the instance specified.
+	 * 
+	 * @param from the instance to copy.
+	 */
+	
 	public void copy (Call from)
 	{
 		Call fromImpl = (Call) from;
@@ -134,6 +244,20 @@
 		return "To: "+_to+" From: "+_from+" ReplyTo: "+_replyTo+" FaultTo: "+_faultTo+" Action: "+_action;
 	}
 	
+	/**
+	 * This instance is valid if all mandatory elements are set.
+	 * 
+	 * @return <code>true</code> if all mandatory elements are set, <code>false</code> otherwise.
+	 */
+	
+	public boolean valid ()
+	{
+		if ((_to != null) && (_action != null))
+			return true;
+		else
+			return false;
+	}
+	
 	private EPR _to = null;
 	private EPR _from = null;
 	private EPR _faultTo = null;

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	2006-10-01 10:55:48 UTC (rev 6509)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	2006-10-01 21:04:06 UTC (rev 6510)
@@ -29,33 +29,78 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 
+/**
+ * The Endpoint Reference class. All services (and clients) can be represented by
+ * an EPR, which is effectively an address. If using SOA principles then the ultimate
+ * recipient of the message should be addressed in a loosely-coupled manner: the service
+ * should multiplex/demultiplex work across "objects" based on the message content and
+ * the EPR should not address a specific "object".
+ * 
+ * @author marklittle
+ *
+ */
 public class EPR
 {
+	/**
+	 * Create a new Endpoint Reference with a null address.
+	 */
+	
 	public EPR ()
 	{
 		_addr = new PortReference();
 	}
 	
+	/**
+	 * Create a new Endpoint Reference with the specified address.
+	 * 
+	 * @param addr the specified address.
+	 */
+	
 	public EPR (PortReference addr)
 	{
 		_addr = addr;
 	}
 
+	/**
+	 * Create a new Endpoint Reference with the specified address.
+	 * 
+	 * @param uri the specified address.
+	 */
+	
 	public EPR (URI uri)
 	{
 		_addr = new PortReference(uri.toString());
 	}
 	
+	/**
+	 * Override the address of this EPR.
+	 * 
+	 * @param uri the new address.
+	 */
+	
 	public void setAddr (PortReference uri)
 	{
 		_addr = uri;
 	}
 	
+	/**
+	 * Get the EPR address.
+	 * 
+	 * @return the address.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
 	public PortReference getAddr () throws URISyntaxException
 	{
 		return _addr;
 	}
 
+	/**
+	 * Copy the contents of the specified EPR into this instance.
+	 * 
+	 * @param from the instance to copy.
+	 */
+	
 	public void copy (EPR from)
 	{
 		EPR fromImpl = (EPR) from;

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	2006-10-01 10:55:48 UTC (rev 6509)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	2006-10-01 21:04:06 UTC (rev 6510)
@@ -34,8 +34,7 @@
 
 /**
  * An implementation of a WS-Addressing EPR. It needs completely rewriting after
- * the interoperability workshop as it is not extensible and not guaranteed to
- * work in the general case. It's morphed with the changing WS-C/WS-T and
+ * the interoperability workshop as it is not extensible. It's morphed with the changing WS-C/WS-T and
  * WS-Addr specifications and their quirks; now that WS-Addr is finalized the
  * old quirks no longer need to be supported so it's best to rewrite this from
  * scratch.
@@ -211,9 +210,7 @@
 	public static class Extension
 	{
 		public static final int REFERENCE_PROPERTIES = 0;
-
 		public static final int REFERENCE_PARAMETERS = 1;
-
 		public static final int NEITHER = 2;
 
 		public Extension(String tag, String prefix, String uri)




More information about the jboss-svn-commits mailing list