Adds SP extensions to Pazpar2 commands and parameters
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / commands / InitCommand.java
index 2ae51a5..144a1a7 100644 (file)
@@ -1,8 +1,9 @@
 package com.indexdata.mkjsf.pazpar2.commands;\r
 \r
+import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
 import com.indexdata.mkjsf.pazpar2.state.StateManager;\r
 \r
-public class InitCommand extends Pazpar2Command {\r
+public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {\r
 \r
   private static final long serialVersionUID = -4915976465898889987L;\r
 \r
@@ -27,5 +28,18 @@ public class InitCommand extends Pazpar2Command {
   public String getSession () {\r
     throw new UnsupportedOperationException("Cannot set or get session id on init command");\r
   }\r
+  \r
+  public InitCommand copy () {\r
+    InitCommand newCommand = new InitCommand(stateMgr);\r
+    for (String parameterName : parameters.keySet()) {\r
+      newCommand.setParameterInState(parameters.get(parameterName).copy());      \r
+    }    \r
+    return newCommand;\r
+  }\r
+  \r
+  public ServiceProxyCommand getSp() {\r
+    return this;\r
+  }\r
+\r
 \r
 }\r