2006/unicorn/src/org/w3c/unicorn/request UploadRequest.java,1.5,1.6 URIRequest.java,1.6,1.7 Request.java,1.7,1.8 DirectRequestGET.java,1.6,1.7 DirectRequestPOST.java,1.4,1.5

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/request
In directory hutz:/tmp/cvs-serv10353/src/org/w3c/unicorn/request

Modified Files:
	UploadRequest.java URIRequest.java Request.java 
	DirectRequestGET.java DirectRequestPOST.java 
Log Message:
the observer id is not passed as an argument to the Request objects

Index: DirectRequestPOST.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/request/DirectRequestPOST.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- DirectRequestPOST.java	17 Sep 2009 16:37:19 -0000	1.4
+++ DirectRequestPOST.java	21 Sep 2009 16:28:33 -0000	1.5
@@ -82,7 +82,7 @@
 	 */
 	protected DirectRequestPOST(final String sURL,
 			final String sInputParameterName, DirectInputModule aInputModule,
-			final String responseType) {
+			final String responseType, String observerId) {
 		super();
 		logger.trace("Constructor");
 		logger.debug("URL : " + sURL + ".");
@@ -90,6 +90,7 @@
 		logger.debug("Input module : " + aInputModule + ".");
 		mapOfParameter = new Hashtable<String, String>();
 		this.sURL = sURL;
+		this.observerId = observerId;
 		addParameter(sInputParameterName, aInputModule.getStringContent());
 		setResponseType(responseType);
 	}

Index: DirectRequestGET.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/request/DirectRequestGET.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- DirectRequestGET.java	17 Sep 2009 16:37:19 -0000	1.6
+++ DirectRequestGET.java	21 Sep 2009 16:28:33 -0000	1.7
@@ -48,13 +48,14 @@
 	 */
 	protected DirectRequestGET(final String sURL,
 			final String sInputParameterName, DirectInputModule aInputModule,
-			final String responseType) {
+			final String responseType, String observerId) {
 		super();
 		logger.trace("Constructor");
 		logger.debug("URL : " + sURL + ".");
 		logger.debug("Input parameter name : " + sInputParameterName + ".");
 		logger.debug("Input module : " + aInputModule + ".");
 		this.sURL = sURL;
+		this.observerId = observerId;
 		addParameter(sInputParameterName, aInputModule.getStringContent());
 		setResponseType(responseType);
 	}

Index: UploadRequest.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/request/UploadRequest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- UploadRequest.java	17 Sep 2009 16:37:18 -0000	1.5
+++ UploadRequest.java	21 Sep 2009 16:28:33 -0000	1.6
@@ -65,13 +65,14 @@
 	 */
 	protected UploadRequest(final String sURL,
 			final String sInputParameterName, final UploadInputModule aInputModule,
-			final String responseType) {
+			final String responseType, String observerId) {
 		super();
 		logger.trace("Constructor");
 		logger.debug("URL : " + sURL + ".");
 		logger.debug("Input parameter name : " + sInputParameterName + ".");
 		logger.debug("Input module : " + aInputModule + ".");
 		this.sURL = sURL;
+		this.observerId = observerId;
 		this.sInputParameterName = sInputParameterName;
 		this.aUploadInputModule = (UploadInputModule) aInputModule;
 		this.mapOfParameter = new Hashtable<String, String>();

Index: Request.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/request/Request.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Request.java	21 Sep 2009 15:51:33 -0000	1.7
+++ Request.java	21 Sep 2009 16:28:33 -0000	1.8
@@ -38,6 +38,8 @@
 	 * Type of the response for the request
 	 */
 	protected String responseType = null;
+	
+	protected String observerId;
 
 	/**
 	 * Sets the language of the request
@@ -96,7 +98,7 @@
 	 */
 	public static Request createRequest(final InputModule aInputModule,
 			final String sURL, final String sInputParameterName,
-			final boolean bIsPost, final String responseType) {
+			final boolean bIsPost, final String responseType, String observerId) {
 
 		logger.trace("createRequest");
 		logger.debug("InputModule : " + aInputModule + ".");
@@ -107,17 +109,17 @@
 		case DIRECT:
 			if (bIsPost) {
 				return new DirectRequestPOST(sURL, sInputParameterName, 
-						(DirectInputModule) aInputModule, responseType);
+						(DirectInputModule) aInputModule, responseType, observerId);
 			} else {
 				return new DirectRequestGET(sURL, sInputParameterName,
-						(DirectInputModule) aInputModule, responseType);
+						(DirectInputModule) aInputModule, responseType, observerId);
 			}
 		case UPLOAD:
 			return new UploadRequest(sURL, sInputParameterName,
-					(UploadInputModule) aInputModule, responseType);
+					(UploadInputModule) aInputModule, responseType, observerId);
 		case URI:
 			return new URIRequest(sURL, sInputParameterName,
-					(URIInputModule) aInputModule, responseType);
+					(URIInputModule) aInputModule, responseType, observerId);
 		}
 		return null;
 	}
@@ -148,4 +150,12 @@
 
 		return res;
 	}
+
+	public String getObserverId() {
+		return observerId;
+	}
+
+	public void setObserverId(String observerId) {
+		this.observerId = observerId;
+	}
 }

Index: URIRequest.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/request/URIRequest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- URIRequest.java	21 Sep 2009 15:55:11 -0000	1.6
+++ URIRequest.java	21 Sep 2009 16:28:33 -0000	1.7
@@ -14,6 +14,7 @@
 import java.net.URLConnection;
 import java.net.URLEncoder;
 
+import org.w3c.unicorn.Framework;
 import org.w3c.unicorn.contract.EnumInputMethod;
 import org.w3c.unicorn.exceptions.UnicornException;
 import org.w3c.unicorn.input.URIInputModule;
@@ -56,13 +57,14 @@
 	 *             odd error occured
 	 */
 	public URIRequest(final String sURL, final String sInputParameterName,
-			URIInputModule aInputModule, final String responseType) {
+			URIInputModule aInputModule, final String responseType, String observerId) {
 		super();
 		logger.trace("Constructor");
 		logger.debug("URL : " + sURL + ".");
 		logger.debug("Input parameter name : " + sInputParameterName + ".");
 		logger.debug("Input module : " + aInputModule + ".");
 		this.sURL = sURL;
+		this.observerId = observerId;
 		final URIInputModule aURIInputModule = (URIInputModule) aInputModule;
 		this.addParameter(sInputParameterName, aURIInputModule.getURI());
 		this.setResponseType(responseType);
@@ -132,10 +134,10 @@
 		} catch (MalformedURLException e) {
 			throw new UnicornException(new Message(e));
 		} catch (ConnectException e) {
-			throw new UnicornException(Message.Level.ERROR, "$message_observer_connect_exception", null);
+			throw new UnicornException(Message.Level.ERROR, "$message_observer_connect_exception " + Framework.mapOfObserver.get(observerId).getName(sLang.split(",")[0]), null);
 		} catch (SocketTimeoutException e) {
 			if (e.getMessage().contains("connect timed out")) {
-				throw new UnicornException(Message.Level.ERROR, "$message_observer_connect_exception", null);
+				throw new UnicornException(Message.Level.ERROR, "$message_observer_connect_exception " + Framework.mapOfObserver.get(observerId).getName(sLang.split(",")[0]), null);
 			} else if (e.getMessage().contains("Read timed out")) {
 				throw new UnicornException(Message.Level.ERROR, "$message_observer_read_timeout", null);
 			} else {

Received on Monday, 21 September 2009 16:28:46 UTC