Moves Auth response class to SP data package
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Tue, 21 May 2013 13:21:18 +0000 (09:21 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Tue, 21 May 2013 13:21:18 +0000 (09:21 -0400)
src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Bean.java
src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyExtensions.java
src/main/java/com/indexdata/mkjsf/pazpar2/data/AuthResponse.java [deleted file]
src/main/java/com/indexdata/mkjsf/pazpar2/data/ResponseParser.java
src/main/java/com/indexdata/mkjsf/pazpar2/data/Responses.java
src/main/java/com/indexdata/mkjsf/pazpar2/data/sp/AuthResponse.java [new file with mode: 0644]

index 5b45551..29d9280 100644 (file)
@@ -172,17 +172,19 @@ public class Pz2Bean implements Pz2Interface, StateListener, Configurable, Seria
    * Refreshes the data objects listed in 'commands' from pazpar2\r
    * \r
    * @param commands\r
-   * @return Number of activeclients at the time of the 'show' command\r
+   * @return Number of activeclients at the time of the 'show' command,\r
+   *         or 'new' if search was just initiated.\r
    */\r
   public String update (String commands) {\r
     logger.debug("Request to update: " + commands);\r
     try {\r
       if (commands.equals("search")) {\r
         doSearch();\r
-        return "";\r
+        return "new";\r
       } else if (commands.equals("record")) {\r
         return doRecord();\r
       } else if (pzresp.getSearch().isNew()) {\r
+        // For returning notification of 'search started' quickly to UI\r
         logger.info("New search. Marking it old, then returning 'new' to trigger another round-trip.");\r
         pzresp.getSearch().setIsNew(false);\r
         return "new";\r
index 8629b38..3c0da10 100644 (file)
@@ -16,10 +16,10 @@ import com.indexdata.mkjsf.pazpar2.commands.CommandParameter;
 import com.indexdata.mkjsf.pazpar2.commands.Pazpar2Commands;\r
 import com.indexdata.mkjsf.pazpar2.commands.sp.AuthCommand;\r
 import com.indexdata.mkjsf.pazpar2.commands.sp.InitDocUpload;\r
-import com.indexdata.mkjsf.pazpar2.data.AuthResponse;\r
 import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;\r
 import com.indexdata.mkjsf.pazpar2.data.ResponseParser;\r
 import com.indexdata.mkjsf.pazpar2.data.Responses;\r
+import com.indexdata.mkjsf.pazpar2.data.sp.AuthResponse;\r
 import com.indexdata.mkjsf.pazpar2.data.sp.CategoriesResponse;\r
 import com.indexdata.mkjsf.pazpar2.sp.auth.ServiceProxyUser;\r
 import com.indexdata.mkjsf.utils.Utils;\r
diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/data/AuthResponse.java b/src/main/java/com/indexdata/mkjsf/pazpar2/data/AuthResponse.java
deleted file mode 100644 (file)
index a0a015f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.indexdata.mkjsf.pazpar2.data;\r
-\r
-public class AuthResponse extends ResponseDataObject {\r
-\r
-  private static final long serialVersionUID = 8006774126022849936L;\r
-\r
-  public String getDisplayName () {\r
-    return getOneElementValue("displayName");\r
-  }\r
-  \r
-  public String getRealm () {\r
-    return getOneElementValue("realm");\r
-  }\r
-  \r
-  public String getStatus () {\r
-    return getOneElementValue("status");\r
-  }\r
-  \r
-  public String getAuthenticationType () {\r
-    return getOneElementValue("type");\r
-  }\r
-  \r
-\r
-  \r
-}\r
index a26b6ad..cf60173 100644 (file)
@@ -19,6 +19,7 @@ import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.DefaultHandler;\r
 \r
 import com.indexdata.mkjsf.pazpar2.ClientCommandResponse;\r
+import com.indexdata.mkjsf.pazpar2.data.sp.AuthResponse;\r
 import com.indexdata.mkjsf.pazpar2.data.sp.CategoriesResponse;\r
 import com.indexdata.mkjsf.pazpar2.data.sp.TargetCategory;\r
 \r
index 920ef6b..1df2363 100644 (file)
@@ -16,6 +16,7 @@ import org.apache.log4j.Logger;
 \r
 import com.indexdata.mkjsf.errors.ErrorHelper;\r
 import com.indexdata.mkjsf.errors.ErrorInterface;\r
+import com.indexdata.mkjsf.pazpar2.data.sp.AuthResponse;\r
 import com.indexdata.mkjsf.pazpar2.data.sp.CategoriesResponse;\r
 import com.indexdata.mkjsf.utils.Utils;\r
 \r
diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/data/sp/AuthResponse.java b/src/main/java/com/indexdata/mkjsf/pazpar2/data/sp/AuthResponse.java
new file mode 100644 (file)
index 0000000..751f39f
--- /dev/null
@@ -0,0 +1,27 @@
+package com.indexdata.mkjsf.pazpar2.data.sp;\r
+\r
+import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;\r
+\r
+public class AuthResponse extends ResponseDataObject {\r
+\r
+  private static final long serialVersionUID = 8006774126022849936L;\r
+\r
+  public String getDisplayName () {\r
+    return getOneElementValue("displayName");\r
+  }\r
+  \r
+  public String getRealm () {\r
+    return getOneElementValue("realm");\r
+  }\r
+  \r
+  public String getStatus () {\r
+    return getOneElementValue("status");\r
+  }\r
+  \r
+  public String getAuthenticationType () {\r
+    return getOneElementValue("type");\r
+  }\r
+  \r
+\r
+  \r
+}\r