From: Niels Erik G. Nielsen Date: Tue, 21 May 2013 13:21:18 +0000 (-0400) Subject: Moves Auth response class to SP data package X-Git-Tag: v0.0.7~92 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=056883036f0be0d1bf0a06d0f5842d382239adf9;p=mkjsf-moved-to-github.git Moves Auth response class to SP data package --- diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Bean.java b/src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Bean.java index 5b45551..29d9280 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Bean.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Bean.java @@ -172,17 +172,19 @@ public class Pz2Bean implements Pz2Interface, StateListener, Configurable, Seria * Refreshes the data objects listed in 'commands' from pazpar2 * * @param commands - * @return Number of activeclients at the time of the 'show' command + * @return Number of activeclients at the time of the 'show' command, + * or 'new' if search was just initiated. */ public String update (String commands) { logger.debug("Request to update: " + commands); try { if (commands.equals("search")) { doSearch(); - return ""; + return "new"; } else if (commands.equals("record")) { return doRecord(); } else if (pzresp.getSearch().isNew()) { + // For returning notification of 'search started' quickly to UI logger.info("New search. Marking it old, then returning 'new' to trigger another round-trip."); pzresp.getSearch().setIsNew(false); return "new"; diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyExtensions.java b/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyExtensions.java index 8629b38..3c0da10 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyExtensions.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyExtensions.java @@ -16,10 +16,10 @@ import com.indexdata.mkjsf.pazpar2.commands.CommandParameter; import com.indexdata.mkjsf.pazpar2.commands.Pazpar2Commands; import com.indexdata.mkjsf.pazpar2.commands.sp.AuthCommand; import com.indexdata.mkjsf.pazpar2.commands.sp.InitDocUpload; -import com.indexdata.mkjsf.pazpar2.data.AuthResponse; import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject; import com.indexdata.mkjsf.pazpar2.data.ResponseParser; import com.indexdata.mkjsf.pazpar2.data.Responses; +import com.indexdata.mkjsf.pazpar2.data.sp.AuthResponse; import com.indexdata.mkjsf.pazpar2.data.sp.CategoriesResponse; import com.indexdata.mkjsf.pazpar2.sp.auth.ServiceProxyUser; import com.indexdata.mkjsf.utils.Utils; 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 index a0a015f..0000000 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/data/AuthResponse.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.indexdata.mkjsf.pazpar2.data; - -public class AuthResponse extends ResponseDataObject { - - private static final long serialVersionUID = 8006774126022849936L; - - public String getDisplayName () { - return getOneElementValue("displayName"); - } - - public String getRealm () { - return getOneElementValue("realm"); - } - - public String getStatus () { - return getOneElementValue("status"); - } - - public String getAuthenticationType () { - return getOneElementValue("type"); - } - - - -} diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/data/ResponseParser.java b/src/main/java/com/indexdata/mkjsf/pazpar2/data/ResponseParser.java index a26b6ad..cf60173 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/data/ResponseParser.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/data/ResponseParser.java @@ -19,6 +19,7 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import com.indexdata.mkjsf.pazpar2.ClientCommandResponse; +import com.indexdata.mkjsf.pazpar2.data.sp.AuthResponse; import com.indexdata.mkjsf.pazpar2.data.sp.CategoriesResponse; import com.indexdata.mkjsf.pazpar2.data.sp.TargetCategory; diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/data/Responses.java b/src/main/java/com/indexdata/mkjsf/pazpar2/data/Responses.java index 920ef6b..1df2363 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/data/Responses.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/data/Responses.java @@ -16,6 +16,7 @@ import org.apache.log4j.Logger; import com.indexdata.mkjsf.errors.ErrorHelper; import com.indexdata.mkjsf.errors.ErrorInterface; +import com.indexdata.mkjsf.pazpar2.data.sp.AuthResponse; import com.indexdata.mkjsf.pazpar2.data.sp.CategoriesResponse; import com.indexdata.mkjsf.utils.Utils; 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 index 0000000..751f39f --- /dev/null +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/data/sp/AuthResponse.java @@ -0,0 +1,27 @@ +package com.indexdata.mkjsf.pazpar2.data.sp; + +import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject; + +public class AuthResponse extends ResponseDataObject { + + private static final long serialVersionUID = 8006774126022849936L; + + public String getDisplayName () { + return getOneElementValue("displayName"); + } + + public String getRealm () { + return getOneElementValue("realm"); + } + + public String getStatus () { + return getOneElementValue("status"); + } + + public String getAuthenticationType () { + return getOneElementValue("type"); + } + + + +}