com.indexdata.mkjsf.pazpar2
Class ServiceProxyClient

java.lang.Object
  extended by com.indexdata.mkjsf.pazpar2.ServiceProxyClient
All Implemented Interfaces:
Configurable, SearchClient, Serializable

public class ServiceProxyClient
extends Object
implements SearchClient

Search client handling Service Proxy requests.

Author:
Niels Erik
See Also:
Serialized Form

Nested Class Summary
 class ServiceProxyClient.ProxyPz2ResponseHandler
           
 
Field Summary
static String MODULENAME
           
static String SP_INIT_DOC_PATHS
           
 
Constructor Summary
ServiceProxyClient()
           
 
Method Summary
 ServiceProxyClient cloneMe()
           
 void configure(ConfigurationReader configReader)
          Configures the Configurable using the configuration obtained by the provided configuration reader
 List<String> documentConfiguration()
          The components documentation of how it was configured.
 HttpResponseWrapper executeCommand(Pazpar2Command command)
           
 Configuration getConfiguration()
           
 Map<String,String> getDefaults()
          Returns default configuration parameters for the client.
 List<String> getInitDocPaths()
           
 String getModuleName()
          Returns the configuration name of the client
 String getReasonPhrase()
           
 String getServiceUrl()
           
 int getStatusCode()
           
 boolean hasServiceUrl()
          Returns true if a Service Proxy URL was defined yet.
 boolean isAuthenticatingClient()
           
 HttpResponseWrapper postInitDoc(byte[] initDoc, Pazpar2Command command)
           
 ClientCommandResponse postInitDoc(String filePath)
           
 ClientCommandResponse send(Pazpar2Command command)
          Makes the request
 void setSearchCommand(Pazpar2Command command)
          Does nothing in Service Proxy context
 void setServiceUrl(String url)
          Sets the URL of the Service Proxy that should service requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULENAME

public static final String MODULENAME
See Also:
Constant Field Values

SP_INIT_DOC_PATHS

public static final String SP_INIT_DOC_PATHS
See Also:
Constant Field Values
Constructor Detail

ServiceProxyClient

public ServiceProxyClient()
Method Detail

configure

public void configure(ConfigurationReader configReader)
               throws MissingConfigurationContextException
Description copied from interface: Configurable
Configures the Configurable using the configuration obtained by the provided configuration reader

Specified by:
configure in interface Configurable
Parameters:
configReader - used for reading the configuration
Throws:
MissingConfigurationContextException

isAuthenticatingClient

public boolean isAuthenticatingClient()
Specified by:
isAuthenticatingClient in interface SearchClient

send

public ClientCommandResponse send(Pazpar2Command command)
Makes the request

Parameters:
request -
Returns:
HTTP response as a String
Throws:
org.apache.http.client.ClientProtocolException
IOException

getStatusCode

public int getStatusCode()

getReasonPhrase

public String getReasonPhrase()

setSearchCommand

public void setSearchCommand(Pazpar2Command command)
Does nothing in Service Proxy context

Specified by:
setSearchCommand in interface SearchClient

executeCommand

public HttpResponseWrapper executeCommand(Pazpar2Command command)
Specified by:
executeCommand in interface SearchClient

cloneMe

public ServiceProxyClient cloneMe()
Specified by:
cloneMe in interface SearchClient

getDefaults

public Map<String,String> getDefaults()
Returns default configuration parameters for the client.

Specified by:
getDefaults in interface Configurable
Returns:

getModuleName

public String getModuleName()
Returns the configuration name of the client

Specified by:
getModuleName in interface Configurable
Returns:
name of the part that is to be configured

documentConfiguration

public List<String> documentConfiguration()
Description copied from interface: Configurable
The components documentation of how it was configured.

Specified by:
documentConfiguration in interface Configurable
Returns:
a list of Strings describing configuration details

postInitDoc

public ClientCommandResponse postInitDoc(String filePath)
                                  throws IOException
Throws:
IOException

getInitDocPaths

public List<String> getInitDocPaths()

postInitDoc

public HttpResponseWrapper postInitDoc(byte[] initDoc,
                                       Pazpar2Command command)

setServiceUrl

public void setServiceUrl(String url)
Sets the URL of the Service Proxy that should service requests.

Specified by:
setServiceUrl in interface SearchClient

getConfiguration

public Configuration getConfiguration()
Specified by:
getConfiguration in interface SearchClient

getServiceUrl

public String getServiceUrl()
Specified by:
getServiceUrl in interface SearchClient

hasServiceUrl

public boolean hasServiceUrl()
Returns true if a Service Proxy URL was defined yet.

Specified by:
hasServiceUrl in interface SearchClient


Copyright © 2013. All Rights Reserved.