1 package com.indexdata.mkjsf.pazpar2.commands;
\r
3 import org.apache.log4j.Logger;
\r
5 import com.indexdata.mkjsf.pazpar2.commands.sp.InitCommandSp;
\r
6 import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;
\r
9 * Represents a Pazpar2 <code>init</code> command, can be accessed by <code>pzreq.init</code>
\r
11 * @author Niels Erik
\r
14 public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
\r
16 private static final long serialVersionUID = -4915976465898889987L;
\r
17 private static Logger logger = Logger.getLogger(InitCommand.class);
\r
18 private InitCommandSp spCommand = null;
\r
20 public InitCommand() {
\r
25 * Sets the <code>clear</code> parameter. See Pazpar2 documentation for details.
\r
29 public void setClear(String clear) {
\r
30 setParameterInState(new CommandParameter("clear","=",clear));
\r
34 * Returns the <code>clear</code> parameter value.
\r
36 public String getClear() {
\r
37 return getParameterValue("clear");
\r
41 * Sets the <code>service</code> parameter. See Pazpar2 documentation for details.
\r
44 public void setService(String serviceId) {
\r
45 setParameterInState(new CommandParameter("service","=",serviceId));
\r
49 * Returns the <code>service</code> parameter value.
\r
51 public String getService() {
\r
52 return getParameterValue("service");
\r
56 * Disabled, not supported for <code>init</code>
\r
59 public void setSession (String sessionId) {
\r
60 throw new UnsupportedOperationException("Cannot set session id on init command");
\r
64 * Disabled, not supported for <code>init</code>
\r
67 public String getSession () {
\r
68 throw new UnsupportedOperationException("Cannot set or get session id on init command");
\r
71 public InitCommand copy () {
\r
72 logger.info("Copying init command");
\r
73 InitCommand newCommand = new InitCommand();
\r
74 for (String parameterName : parameters.keySet()) {
\r
75 newCommand.setParameterInState(parameters.get(parameterName).copy());
\r
77 newCommand.spCommand = new InitCommandSp(this);
\r
78 newCommand.spCommand.setUploadedInitDoc(spCommand.getUploadedInitDoc());
\r
82 public ServiceProxyCommand getSp() {
\r
83 if (spCommand==null) {
\r
84 spCommand = new InitCommandSp(this);
\r
90 public boolean spOnly() {
\r