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
8 public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
\r
10 private static final long serialVersionUID = -4915976465898889987L;
\r
11 private static Logger logger = Logger.getLogger(InitCommand.class);
\r
12 private InitCommandSp spCommand = null;
\r
14 public InitCommand() {
\r
18 public void setClear(String clear) {
\r
19 setParameterInState(new CommandParameter("clear","=",clear));
\r
22 public String getClear() {
\r
23 return getParameterValue("clear");
\r
26 public void setService(String serviceId) {
\r
27 setParameterInState(new CommandParameter("service","=",serviceId));
\r
30 public String getService() {
\r
31 return getParameterValue("service");
\r
35 public void setSession (String sessionId) {
\r
36 throw new UnsupportedOperationException("Cannot set session id on init command");
\r
40 public String getSession () {
\r
41 throw new UnsupportedOperationException("Cannot set or get session id on init command");
\r
44 public InitCommand copy () {
\r
45 logger.info("Copying init command");
\r
46 InitCommand newCommand = new InitCommand();
\r
47 for (String parameterName : parameters.keySet()) {
\r
48 newCommand.setParameterInState(parameters.get(parameterName).copy());
\r
50 newCommand.spCommand = this.spCommand;
\r
54 public ServiceProxyCommand getSp() {
\r
55 if (spCommand==null) {
\r
56 spCommand = new InitCommandSp(this);
\r
62 public boolean spOnly() {
\r