X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2Fsp%2FAuthCommand.java;h=67780e5cb21c1ceee793c567a76a2837da03108e;hb=017a20f6da489d3d968025f0442213aee7252c41;hp=5013271219d42a2a874f0f306620f76723aed4a4;hpb=45780ca51a3f1a967acda7c4d7d71aebe7081a67;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/AuthCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/AuthCommand.java index 5013271..67780e5 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/AuthCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/AuthCommand.java @@ -9,6 +9,14 @@ import com.indexdata.mkjsf.pazpar2.commands.Pazpar2Command; import com.indexdata.mkjsf.pazpar2.data.ResponseParser; import com.indexdata.mkjsf.pazpar2.data.sp.SpResponseDataObject; +/** + * Represents a Service Proxy auth command. + * + *

Authenticates a user against a Pazpar2 Service Proxy

+ * + * @author Niels Erik + * + */ public class AuthCommand extends Pazpar2Command implements ServiceProxyCommand { private static final long serialVersionUID = 5487611235664162578L; @@ -34,33 +42,59 @@ public class AuthCommand extends Pazpar2Command implements ServiceProxyCommand { return responseObject; } + /** + * Normalizes the response XML for the benefit of the SAX parser that creates data objects. + *

The parser expects responses to have document element names corresponding to the names of + * the commands that created the responses.

+ * + * @param responseString + * @param newName + * @return + */ private String renameResponseElement(String responseString, String newName) { responseString = responseString.replace("", "<" + newName + ">"); responseString = responseString.replace("", ""); return responseString; } - + /** + * Sets Service Proxy command parameter action. See Service Proxy documentation for details. + */ public void setAction (String action) { setParameterInState(new CommandParameter("action","=",action)); } + /** + * Gets parameter value for action + */ public String getAction () { return getParameterValue("action"); } + /** + * Sets Service Proxy command parameter username. See Service Proxy documentation for details. + */ public void setUsername(String username) { setParameterInState(new CommandParameter("username","=",username)); } + /** + * Gets parameter value for username + */ public String getUsername () { return getParameterValue("username"); } - + + /** + * Sets Service Proxy command parameter password. See Service Proxy documentation for details. + */ public void setPassword (String password) { setParameterInState(new CommandParameter("password","=",password)); } + /** + * Gets parameter value for password + */ public String getPassword () { return getParameterValue("password"); }