com.indexdata.mkjsf.pazpar2
Class Pz2Client

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

public class Pz2Client
extends Object
implements SearchClient

Search client handling straight Pazpar2 requests.

Although it is described here as straight Pazpar2, the client itself actually represents a layer between Pazpar2 and the JSF application because it uses the Pazpar2 client from the library masterkey-common.

That client, which is the one also used by the Service Proxy, does perform certain types of session handling, bootstraps lost sessions, avoids repeating already executed queries etc, so it is -- in other words -- still a mediated interaction with Pazpar2 that takes place. At least for now.

Author:
Niels Erik
See Also:
Serialized Form

Field Summary
static Map<String,String> DEFAULTS
           
static String MODULENAME
           
 
Constructor Summary
Pz2Client()
           
 
Method Summary
 boolean authenticate()
           
 Pz2Client cloneMe()
           
 void configure(ConfigurationReader configReader)
          Configures the Configurable using the configuration obtained by the provided configuration reader
 List<String> documentConfiguration()
          Provides configuration documentation -- mostly for diagnosing problems
 HttpResponseWrapper executeCommand(Pazpar2Command command)
          Runs the give Pazpar2 command and returns a response wrapper with either the received response or with some form of error message.
 Configuration getConfiguration()
           
 Map<String,String> getDefaults()
          Returns default configuration parameters for the client.
 String getModuleName()
          Returns the configuration name of the client
 String getServiceId()
          Returns the Pazpar2 Service ID
 String getServiceUrl()
          Returns the currently configured Papzar2 URL.
 boolean hasServiceUrl()
          Returns true if a Papzar2 URL was defined yet.
 boolean isAuthenticated()
           
 boolean isAuthenticatingClient()
           
 void setSearchCommand(Pazpar2Command command)
           
 void setServiceId(String serviceId)
          Sets the service ID that Pazpar2 should use when servicing requests
 void setServiceUrl(String serviceUrl)
          Sets the Pazpar2 URL to use for 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

DEFAULTS

public static Map<String,String> DEFAULTS
Constructor Detail

Pz2Client

public Pz2Client()
Method Detail

configure

public void configure(ConfigurationReader configReader)
               throws ConfigurationException
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:
ConfigurationException

isAuthenticatingClient

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

isAuthenticated

public boolean isAuthenticated()

authenticate

public boolean authenticate()

setSearchCommand

public void setSearchCommand(Pazpar2Command command)
Specified by:
setSearchCommand in interface SearchClient

executeCommand

public HttpResponseWrapper executeCommand(Pazpar2Command command)
Runs the give Pazpar2 command and returns a response wrapper with either the received response or with some form of error message. It is intended that this method never throws an exception. All events are supposed to be captured and returned in some form of response.

Specified by:
executeCommand in interface SearchClient

cloneMe

public Pz2Client 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()
Provides configuration documentation -- mostly for diagnosing problems

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

getConfiguration

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

getServiceUrl

public String getServiceUrl()
Returns the currently configured Papzar2 URL.

Specified by:
getServiceUrl in interface SearchClient

hasServiceUrl

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

Specified by:
hasServiceUrl in interface SearchClient

setServiceUrl

public void setServiceUrl(String serviceUrl)
Sets the Pazpar2 URL to use for requests.

Specified by:
setServiceUrl in interface SearchClient

getServiceId

public String getServiceId()
Returns the Pazpar2 Service ID


setServiceId

public void setServiceId(String serviceId)
Sets the service ID that Pazpar2 should use when servicing requests

Parameters:
serviceId -


Copyright © 2013. All Rights Reserved.