Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkjsf.git into...
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / data / sp / SpResponseDataObject.java
diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/data/sp/SpResponseDataObject.java b/src/main/java/com/indexdata/mkjsf/pazpar2/data/sp/SpResponseDataObject.java
new file mode 100644 (file)
index 0000000..7816776
--- /dev/null
@@ -0,0 +1,36 @@
+package com.indexdata.mkjsf.pazpar2.data.sp;\r
+\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
+\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
+        && getServiceError().getCode().equals("3")\r
+        && getServiceError().getValue().equals("command")) {        \r
+        return true;\r
+    }\r
+    return false;\r
+  }\r
+  \r
+}\r