Moves response objects from pz2 bean to dedicated bean
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / pz2utils4jsf / pazpar2 / Pz2Client.java
index affd08d..39adf03 100644 (file)
@@ -9,9 +9,6 @@ import java.util.HashMap;
 import java.util.List;\r
 import java.util.Map;\r
 \r
-import javax.enterprise.context.SessionScoped;\r
-import javax.inject.Named;\r
-\r
 import org.apache.log4j.Logger;\r
 \r
 import com.indexdata.masterkey.config.MissingMandatoryParameterException;\r
@@ -26,10 +23,9 @@ import com.indexdata.masterkey.pazpar2.client.exceptions.ProxyErrorException;
 import com.indexdata.pz2utils4jsf.config.Configuration;\r
 import com.indexdata.pz2utils4jsf.config.ConfigurationReader;\r
 import com.indexdata.pz2utils4jsf.errors.ConfigurationException;\r
-import com.indexdata.pz2utils4jsf.pazpar2.commands.Pazpar2Command;\r
+import com.indexdata.pz2utils4jsf.pazpar2.commands.CommandReadOnly;\r
 import com.indexdata.pz2utils4jsf.utils.Utils;\r
 \r
-@Named @SessionScoped \r
 public class Pz2Client implements SearchClient {\r
 \r
   private static final long serialVersionUID = 5414266730169982028L;\r
@@ -85,13 +81,13 @@ public class Pz2Client implements SearchClient {
   }\r
   \r
   @Override\r
-  public void setSearchCommand(Pazpar2Command command) {\r
+  public void setSearchCommand(CommandReadOnly command) {\r
     ClientCommand clientCommand = new ClientCommand(command.getName(), command.getEncodedQueryString());\r
     client.setSearchCommand(clientCommand);    \r
   }\r
 \r
   @Override\r
-  public CommandResponse executeCommand(Pazpar2Command command, ByteArrayOutputStream baos) \r
+  public CommandResponse executeCommand(CommandReadOnly command, ByteArrayOutputStream baos) \r
        throws Pazpar2ErrorException, IOException {\r
     ClientCommand clientCommand = new ClientCommand(command.getName(), command.getEncodedQueryString());\r
     Pazpar2HttpResponse pz2HttpResponse = client.executeCommand(clientCommand, baos);\r