\r
import com.indexdata.masterkey.pazpar2.client.Pazpar2HttpResponse;\r
\r
-public class ClientCommandResponse implements CommandResponse {\r
+public class ClientCommandResponse implements HttpResponseWrapper {\r
\r
private int statusCode;\r
private String contentType;\r
+++ /dev/null
-package com.indexdata.mkjsf.pazpar2;\r
-\r
-public interface CommandResponse {\r
- public int getStatusCode();\r
- public String getContentType();\r
- public String getResponseString();\r
- public byte[] getBytes();\r
- public boolean isBinary();\r
-}\r
private static Logger logger = Logger.getLogger(CommandThread.class);\r
Pazpar2Command command;\r
SearchClient client;\r
- CommandResponse commandResponse = null; \r
+ HttpResponseWrapper commandResponse = null; \r
\r
public CommandThread (Pazpar2Command command, SearchClient client) {\r
this.command = command;\r
* \r
* @return Pazpar2 response as an XML string, possibly a generated error XML\r
*/\r
- public CommandResponse getCommandResponse () {\r
+ public HttpResponseWrapper getCommandResponse () {\r
return commandResponse;\r
}\r
\r
--- /dev/null
+package com.indexdata.mkjsf.pazpar2;\r
+\r
+public interface HttpResponseWrapper {\r
+ public int getStatusCode();\r
+ public String getContentType();\r
+ public String getResponseString();\r
+ public byte[] getBytes();\r
+ public boolean isBinary();\r
+}\r
}\r
for (CommandThread thread : threadList) {\r
String commandName = thread.getCommand().getCommandName();\r
- CommandResponse response = thread.getCommandResponse();\r
+ HttpResponseWrapper response = thread.getCommandResponse();\r
responseLogger.debug("Response was: " + response.getResponseString());\r
Pazpar2ResponseData responseObject = Pazpar2ResponseParser.getParser().getDataObject(response.getResponseString());\r
if (Pazpar2ResponseParser.docTypes.contains(responseObject.getType())) {\r
}\r
\r
@Override\r
- public CommandResponse executeCommand(Pazpar2Command command) {\r
+ public HttpResponseWrapper executeCommand(Pazpar2Command command) {\r
ClientCommandResponse commandResponse = null;\r
ByteArrayOutputStream baos = new ByteArrayOutputStream();\r
ClientCommand clientCommand = new ClientCommand(command.getCommandName(), command.getEncodedQueryString());\r
public interface SearchClient extends Configurable, Serializable {\r
\r
public void setSearchCommand(Pazpar2Command command);\r
- public CommandResponse executeCommand(Pazpar2Command command);\r
+ public HttpResponseWrapper executeCommand(Pazpar2Command command);\r
\r
// Use cloneMe() method if injecting the client with CDI.\r
// The client is used for asynchronously sending off requests\r
}\r
\r
@Override\r
- public CommandResponse executeCommand(Pazpar2Command command) {\r
+ public HttpResponseWrapper executeCommand(Pazpar2Command command) {\r
return send(command);\r
}\r
\r
import org.apache.log4j.Logger;\r
import org.apache.myfaces.custom.fileupload.UploadedFile;\r
\r
-import com.indexdata.mkjsf.pazpar2.CommandResponse;\r
+import com.indexdata.mkjsf.pazpar2.HttpResponseWrapper;\r
\r
public abstract class FileUpload implements Serializable {\r
\r
protected UploadedFile uploadedFile;\r
- protected CommandResponse response;\r
+ protected HttpResponseWrapper response;\r
private static Logger logger = Logger.getLogger(FileUpload.class);\r
private static final long serialVersionUID = 748784638056392862L;\r
\r