1 package com.indexdata.mkjsf.pazpar2;
\r
3 import java.io.Serializable;
\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
10 * Interface abstracting Pazpar2 and Service Proxy services.
\r
12 * @author Niels Erik
\r
15 public interface SearchClient extends Configurable, Serializable {
\r
18 * Search commands are saved for management purposes, like bootstrapping
\r
19 * expired sessions and write log statements.
\r
22 public void setSearchCommand(Pazpar2Command command);
\r
25 * Issues the provided command against the selected Pazpar2 service.
\r
29 public HttpResponseWrapper executeCommand(Pazpar2Command command);
\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
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
43 public boolean isAuthenticatingClient();
\r
46 * Returns the current client configuration - mainly for error resolution.
\r
49 public Configuration getConfiguration();
\r
52 * Returns the URL of the currently selected Pazpar2/SP service
\r
53 * @return URL as a String
\r
55 public String getServiceUrl();
\r
58 * Sets the URL of the Pazpar2/SP service to use for searching.
\r
62 public void setServiceUrl(String url);
\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
68 public boolean hasServiceUrl();
\r