Clears info response when clearing init response
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / data / sp / SpResponseDataObject.java
index 2d18536..7816776 100644 (file)
@@ -1,28 +1,36 @@
 package com.indexdata.mkjsf.pazpar2.data.sp;\r
 \r
-import org.apache.log4j.Logger;\r
-\r
-import com.indexdata.mkjsf.pazpar2.data.ServiceError;\r
 import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;\r
 \r
+/**\r
+ * Base class for Service Proxy-only response data\r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
 public class SpResponseDataObject extends ResponseDataObject {\r
 \r
-  private static final long serialVersionUID = -3098556883153269199L;\r
-  private static Logger logger = Logger.getLogger(SpResponseDataObject.class);\r
+  private static final long serialVersionUID = -3098556883153269199L;  \r
 \r
+  /**\r
+   * <p>Returns true if the command was not recognized by the Service Proxy,\r
+   * passed on to Pazpar2, and then also not recognized by Pazpar2.</p> \r
+   * <p>This results in an error no 3 from Pazpar2 which is passed back through \r
+   * the Service Proxy.</p> \r
+   * <p>This would normally be caused by issuing a Service Proxy-only command that \r
+   * the given Service Proxy is not configured for, or which the given \r
+   * Service Proxy has mapped to a different command name - in both cases it will \r
+   * just fall through.</p> \r
+   *  \r
+   * @return\r
+   */\r
   public boolean unsupportedCommand() {\r
-    if (hasServiceError()) {\r
-      ServiceError serviceError = getApplicationError().getServiceError();\r
-      if (serviceError.getValue().equals("command") &&\r
-          serviceError.getCode().equals("3")) {\r
-        logger.warn("The " + getType() + " command not supported by this Service Proxy (request fell through SP to Pazpar2).");\r
+    if (hasServiceError() \r
+        && getServiceError().getCode().equals("3")\r
+        && getServiceError().getValue().equals("command")) {        \r
         return true;\r
-      } else {\r
-        logger.error("Error encountered: " + serviceError.getCode() + ": " + serviceError.getMsg());\r
-        return false;\r
-      }\r
     }\r
     return false;\r
   }\r
-\r
+  \r
 }\r