X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FInitCommand.java;h=874387437315e3060de784825993165c86f9dee3;hb=6c92dd9a72ae1fa27dd061c1897531879b8c0ba6;hp=d52ec51d3cdaffed45915817e7ecea74c5296cdc;hpb=4fb36567523ea8795fd610bfd92b991215439a65;p=mkjsf-moved-to-github.git
diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
index d52ec51..8743874 100644
--- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
+++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
@@ -5,6 +5,12 @@ import org.apache.log4j.Logger;
import com.indexdata.mkjsf.pazpar2.commands.sp.InitCommandSp;
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;
+/**
+ * init
Pazpar2 command, referenced as: pzreq.init
+ *
+ * @author Niels Erik
+ *
+ */
public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
private static final long serialVersionUID = -4915976465898889987L;
@@ -15,27 +21,48 @@ public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
super("init");
}
+ /**
+ * Sets the clear
parameter. See Pazpar2 documentation for details.
+ *
+ * @param clear
+ */
public void setClear(String clear) {
setParameterInState(new CommandParameter("clear","=",clear));
}
-
+
+ /**
+ * Returns the clear
parameter value.
+ */
public String getClear() {
return getParameterValue("clear");
}
+ /**
+ * Sets the service
parameter. See Pazpar2 documentation for details.
+ * @param serviceId
+ */
public void setService(String serviceId) {
setParameterInState(new CommandParameter("service","=",serviceId));
}
+ /**
+ * Returns the service
parameter value.
+ */
public String getService() {
return getParameterValue("service");
}
+ /**
+ * Disabled, not supported for init
+ */
@Override
public void setSession (String sessionId) {
throw new UnsupportedOperationException("Cannot set session id on init command");
}
-
+
+ /**
+ * Disabled, not supported for init
+ */
@Override
public String getSession () {
throw new UnsupportedOperationException("Cannot set or get session id on init command");
@@ -47,13 +74,16 @@ public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
for (String parameterName : parameters.keySet()) {
newCommand.setParameterInState(parameters.get(parameterName).copy());
}
- newCommand.spCommand = this.spCommand;
+ newCommand.spCommand = new InitCommandSp(this);
+ if (spCommand != null && spCommand.getUploadedInitDoc()!=null) {
+ newCommand.spCommand.setUploadedInitDoc(spCommand.getUploadedInitDoc());
+ }
return newCommand;
}
public ServiceProxyCommand getSp() {
if (spCommand==null) {
- spCommand = new InitCommandSp(this);
+ spCommand = new InitCommandSp(this);
}
return spCommand;
}