X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FRecordCommand.java;h=53068198b47de460d3e0ac59692e512bd8361067;hb=6c92dd9a72ae1fa27dd061c1897531879b8c0ba6;hp=8713ecee7792649738c6b88fc899b2ad81a9b949;hpb=0c6760bcfe354f233870b023d2845f8b9d432781;p=mkjsf-moved-to-github.git
diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java
index 8713ece..5306819 100644
--- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java
+++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java
@@ -1,73 +1,200 @@
package com.indexdata.mkjsf.pazpar2.commands;
-import com.indexdata.mkjsf.pazpar2.state.StateManager;
+import org.apache.log4j.Logger;
-public class RecordCommand extends Pazpar2Command {
+import com.indexdata.mkjsf.pazpar2.ClientCommandResponse;
+import com.indexdata.mkjsf.pazpar2.HttpResponseWrapper;
+import com.indexdata.mkjsf.pazpar2.Pz2Service;
+import com.indexdata.mkjsf.pazpar2.commands.sp.RecordCommandSp;
+import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;
+import com.indexdata.mkjsf.pazpar2.data.RecordResponse;
+import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;
+import com.indexdata.mkjsf.pazpar2.data.ResponseParser;
+
+/**
+ * record
Pazpar2 command, referenced as: pzreq.record
+ *
+ * @author Niels Erik
+ *
+ */
+public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand {
private static final long serialVersionUID = 2817539422114569506L;
+ private static Logger logger = Logger.getLogger(RecordCommand.class);
+ private RecordCommandSp spCommand = null;
- public RecordCommand(StateManager stateMgr) {
- super("record",stateMgr);
+ public RecordCommand() {
+ super("record");
}
+ /**
+ * Special handling of record responses since they come in three distinctly different ways
+ *
id
parameter. See Pazpar2 documentation for details.
+ *
+ * @param recId record ID
+ */
public void setId(String recId) {
setParameter(new CommandParameter("id","=",recId));
}
-
+
+ /**
+ * Returns the id
parameter value.
+ */
public String getId () {
return getParameterValue("id");
}
-
+
+ /**
+ * Sets the offset
parameter. See Pazpar2 documentation for details.
+ */
public void setOffset (String offset) {
setParameter(new CommandParameter("offset","=",offset));
}
-
+
+ /**
+ * Returns the offset
parameter value.
+ */
public String getOffset () {
return getParameterValue("offset");
}
+ /**
+ * Sets the checksum
parameter. See Pazpar2 documentation for details.
+ */
public void setChecksum (String checksum) {
setParameter(new CommandParameter("checksum","=",checksum));
}
+ /**
+ * Returns the checksum
parameter value.
+ */
public String getChecksum () {
return getParameterValue("checksum");
}
+ /**
+ * Sets the nativesyntax
parameter. See Pazpar2 documentation for details.
+ */
public void setNativesyntax (String nativesyntax) {
setParameterInState(new CommandParameter("nativesyntax","=",nativesyntax));
}
+ /**
+ * Returns the nativesyntax
parameter value.
+ */
public String getNativesyntax () {
return getParameterValue("nativesyntax");
}
+ /**
+ * Sets the syntax
parameter. See Pazpar2 documentation for details.
+ */
public void setSyntax (String syntax) {
setParameterInState(new CommandParameter("syntax","=",syntax));
}
+ /**
+ * Returns the syntax
parameter value.
+ */
public String getSyntax () {
return getParameterValue("syntax");
}
+ /**
+ * Sets the esn
parameter. See Pazpar2 documentation for details.
+ */
public void setEsn (String esn) {
setParameter(new CommandParameter("esn","=",esn));
}
+ /**
+ * Returns the esn
parameter value.
+ */
public String getEsn () {
return getParameterValue("esn");
}
+ /**
+ * Sets the binary
parameter. See Pazpar2 documentation for details.
+ */
public void setBinary (String binary) {
setParameter(new CommandParameter("binary","=",binary));
}
+
+ /**
+ * Returns the binary
parameter value.
+ */
+ public String getBinary () {
+ return getParameterValue("binary");
+ }
@Override
public RecordCommand copy () {
- RecordCommand newCommand = new RecordCommand(stateMgr);
+ RecordCommand newCommand = new RecordCommand();
for (String parameterName : parameters.keySet()) {
newCommand.setParameterInState(parameters.get(parameterName).copy());
}
+ newCommand.spCommand = new RecordCommandSp(newCommand);
return newCommand;
}
+
+
+ /**
+ * Returns a record command object with Service Proxy extension parameters
+ *
+ */
+ public RecordCommandSp getSp () {
+ if (spCommand==null) {
+ spCommand = new RecordCommandSp(this);
+ }
+ return spCommand;
+ }
+
+ @Override
+ public boolean spOnly() {
+ return false;
+ }
}