Intercepts empty-stack exc, rec-cmd. mkjsf-16
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / SearchClient.java
1 package com.indexdata.mkjsf.pazpar2;\r
2 \r
3 import java.io.Serializable;\r
4 \r
5 import com.indexdata.mkjsf.config.Configurable;\r
6 import com.indexdata.mkjsf.config.Configuration;\r
7 import com.indexdata.mkjsf.pazpar2.commands.Pazpar2Command;\r
8 \r
9 /**\r
10  * Interface abstracting Pazpar2 and Service Proxy services. \r
11  * \r
12  * @author Niels Erik\r
13  *\r
14  */\r
15 public interface SearchClient extends Configurable, Serializable {\r
16   \r
17   /**\r
18    * Search commands are saved for management purposes, like bootstrapping\r
19    * expired sessions and write log statements. \r
20    * @param command\r
21    */\r
22   public void setSearchCommand(Pazpar2Command command);\r
23   \r
24   /**\r
25    * Issues the provided command against the selected Pazpar2 service.\r
26    * @param command\r
27    * @return\r
28    */\r
29   public HttpResponseWrapper executeCommand(Pazpar2Command command);\r
30   \r
31   // Use cloneMe() method if injecting the client with CDI.\r
32   // The client is used for asynchronously sending off requests\r
33   // to the server AND propagation of context to threads is currently \r
34   // not supported. Trying to do so throws a WELD-001303 error. \r
35   // If propagation to threads gets supported, the cloning can go.\r
36   public SearchClient cloneMe();\r
37   \r
38   /**\r
39    * Basically says if this client accesses a Service Proxy, which (usually)\r
40    * requires some form of authentication, or Pazpar2, which don't.\r
41    * @return\r
42    */\r
43   public boolean isAuthenticatingClient();  \r
44   \r
45   /**\r
46    * Returns the current client configuration - mainly for error resolution.\r
47    * @return\r
48    */\r
49   public Configuration getConfiguration();\r
50   \r
51   /**\r
52    * Returns the URL of the currently selected Pazpar2/SP service\r
53    * @return URL as a String\r
54    */\r
55   public String getServiceUrl();\r
56   \r
57   /**\r
58    * Sets the URL of the Pazpar2/SP service to use for searching. \r
59    * \r
60    * @param url\r
61    */\r
62   public void setServiceUrl(String url);\r
63   \r
64   /**\r
65    * Returns true if a service has been selected, whether by configuration or runtime. \r
66    * @return true is service was selected, false otherwise.\r
67    */\r
68   public boolean hasServiceUrl();  \r
69 }\r