Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6216/src/org/sblim/cimclient/internal/wbem
Modified Files:
Tag: Experimental
WBEMClientCIMXML.java
Log Message:
2614 Remove redundant code in transmitRequest
Index: WBEMClientCIMXML.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/wbem/WBEMClientCIMXML.java,v
retrieving revision 1.21.2.69
retrieving revision 1.21.2.70
diff -u -d -r1.21.2.69 -r1.21.2.70
--- WBEMClientCIMXML.java 23 Jan 2013 20:53:46 -0000 1.21.2.69
+++ WBEMClientCIMXML.java 21 Feb 2013 11:39:17 -0000 1.21.2.70
@@ -70,6 +70,7 @@
* 3553858 2012-08-06 blaschke-oss Append duplicate HTTP header fields instead of replace
* 3554738 2012-08-16 blaschke-oss dump CIM xml by LogAndTraceBroker.trace()
* 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing
+ * 2614 2013-02-21 blaschke-oss Remove redundant code in transmitRequest
*/
package org.sblim.cimclient.internal.wbem;
@@ -1691,6 +1692,8 @@
private String getHttpErrorString(int pStatusCode) {
switch (pStatusCode) {
+ case 400:
+ return "400 - BAD REQUEST";
case 401:
return "401 - UNAUTHORIZED";
case 403:
@@ -1770,7 +1773,6 @@
this.iAuthorization = auth;
}
- String cimError = headers.getField("CIMError");
exceptionNum = WBEMException.CIM_ERR_FAILED;
switch (resultCode) {
@@ -1808,7 +1810,8 @@
// version, CIM version or Protocol Version
// that is expecting
String cimProtocolVersion = headers.getField("CIMProtocolVersion");
- if (cimProtocolVersion == null && cimError == null && useMPost) {
+ if (cimProtocolVersion == null && headers.getField("CIMError") == null
+ && useMPost) {
logger
.trace(Level.FINER,
"Received HTTP Error 501 - NOT IMPLEMENTED with M-POST, falling back to POST");
@@ -1819,20 +1822,12 @@
break;
}
- logger.trace(Level.FINER, "Received HTTP Error 501 - NOT IMPLEMENTED"
- + (cimError != null ? "(CIMError: \"" + cimError + "\")" : "")
- + ", skipping retries");
+ logger.trace(Level.FINER,
+ "Received HTTP Error 501 - NOT IMPLEMENTED, skipping retries");
retries = 0;
break;
case HttpURLConnection.HTTP_BAD_REQUEST: // 400
- logger.trace(Level.FINER, "Received HTTP Error 400 - BAD REQUEST"
- + getHttpErrorString(resultCode)
- + (cimError != null ? " (CIMError: \"" + cimError + "\")" : "")
- + ", skipping retries");
- retries = 0;
- break;
-
case HttpURLConnection.HTTP_FORBIDDEN: // 403
case HttpURLConnection.HTTP_BAD_METHOD: // 405
logger.trace(Level.FINER, "Received HTTP Error "
@@ -1889,6 +1884,9 @@
// Look for CIM error, include in exception if it exists
String errorCIM = connection.getHeaderField("CIMError");
+ if (errorCIM != null) {
+ logger.trace(Level.FINER, "Found CIMError field with value \"" + errorCIM + "\"");
+ }
// Look for OpenPegasus error details, decode and include in exception
// if it exists
|