X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FInitCommand.java;h=3166168ba6708cb7386193cb998f206e10ac9d20;hb=d739ecb22a85d8f982add6d429e069edf7e0dde2;hp=f1f31ef9f54c67d6e990e897fc5c9c8ff6213f5a;hpb=ccb28ae8d5d46d29c40bd8b1637522c212b80636;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 f1f31ef..3166168 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java @@ -1,8 +1,9 @@ package com.indexdata.mkjsf.pazpar2.commands; +import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand; import com.indexdata.mkjsf.pazpar2.state.StateManager; -public class InitCommand extends Pazpar2Command { +public class InitCommand extends Pazpar2Command implements ServiceProxyCommand { private static final long serialVersionUID = -4915976465898889987L; @@ -11,11 +12,19 @@ public class InitCommand extends Pazpar2Command { } public void setClear(String clear) { - setParameter(new CommandParameter("clear","=",clear)); + setParameterInState(new CommandParameter("clear","=",clear)); + } + + public String getClear() { + return getParameterValue("clear"); } public void setService(String serviceId) { - setParameter(new CommandParameter("service","=",serviceId)); + setParameterInState(new CommandParameter("service","=",serviceId)); + } + + public String getService() { + return getParameterValue("service"); } @Override @@ -27,5 +36,23 @@ public class InitCommand extends Pazpar2Command { public String getSession () { throw new UnsupportedOperationException("Cannot set or get session id on init command"); } + + public InitCommand copy () { + InitCommand newCommand = new InitCommand(stateMgr); + for (String parameterName : parameters.keySet()) { + newCommand.setParameterInState(parameters.get(parameterName).copy()); + } + return newCommand; + } + + public ServiceProxyCommand getSp() { + return this; + } + + @Override + public boolean spOnly() { + return false; + } + }