org.jafer.srwserver
Class SRWServer

java.lang.Object
  extended by org.jafer.srwserver.SRWServer
All Implemented Interfaces:
gov.loc.www.zing.srw.interfaces.SRWPort, java.rmi.Remote

public class SRWServer
extends java.lang.Object
implements gov.loc.www.zing.srw.interfaces.SRWPort

This class services SRW requests


Field Summary
private  DatabeanManagerFactory databeanManagerFactory
          Stores a reference to the data bean manager factory to use
protected static java.util.logging.Logger logger
          Stores a reference to the logger
private  SRWServerConfig serverConfig
          Stores a reference to server configuration information
 
Constructor Summary
SRWServer(SRWServerConfig srwserverConfig, DatabeanManagerFactoryConfig factoryConfig)
          The SRWServer is constructed with the databean manager factory that creates a databean manager to process all the search requests.
SRWServer(java.lang.String srwserverConfigLocation, DatabeanManagerFactory factory)
          The SRWServer is constructed with the databean manager factory that creates a databean manager to process all the search requests.
SRWServer(java.lang.String srwserverConfigLocation, java.lang.String databeanManagerConfigLocation)
          The SRWServer is constructed with the databean manager factory that creates a databean manager to process all the search requests.
 
Method Summary
private  void addReplyRecordsToResponse(gov.loc.www.zing.srw.SearchRetrieveRequestType request, gov.loc.www.zing.srw.SearchRetrieveResponseType response, DatabeanManager beanManager)
          This method adds the requested results to the response according to the request information for startrecord, maxrecords, recordpacking values
private  gov.loc.www.zing.srw.SearchRetrieveResponseType createBasicSearchRetrieveResponse(gov.loc.www.zing.srw.SearchRetrieveRequestType request)
          This method creates a basic response object from the request to be populated with the results of the search and retrieve operaration
private  gov.loc.www.zing.srw.diagnostic.DiagnosticType createDiagnostic(java.lang.String code, java.lang.String details)
          This method creates a DiagnosticType for the information provided
 gov.loc.www.zing.srw.ScanResponseType scanOperation(gov.loc.www.zing.srw.ScanRequestType body)
          This method processes a scan operation.
 gov.loc.www.zing.srw.SearchRetrieveResponseType searchRetrieveOperation(gov.loc.www.zing.srw.SearchRetrieveRequestType request)
          This method processes a search and retrieve operation
 void setDatabeanManagerFactory(DatabeanManagerFactory factory)
          Allows the databean factory to be updated on the server
private  boolean validateSearchRetrieveRequest(gov.loc.www.zing.srw.SearchRetrieveRequestType request, gov.loc.www.zing.srw.SearchRetrieveResponseType response)
          This method makes sure that the request contains all the required parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static java.util.logging.Logger logger
Stores a reference to the logger


databeanManagerFactory

private DatabeanManagerFactory databeanManagerFactory
Stores a reference to the data bean manager factory to use


serverConfig

private SRWServerConfig serverConfig
Stores a reference to server configuration information

Constructor Detail

SRWServer

public SRWServer(java.lang.String srwserverConfigLocation,
                 java.lang.String databeanManagerConfigLocation)
          throws JaferException
The SRWServer is constructed with the databean manager factory that creates a databean manager to process all the search requests. The databean manager will be configured using the config file

Parameters:
srwserverConfigLocation - The location of the resource in the distribution that will be retrieved as a stream using class.getResourceAsStream() to load the srwserver config details
databeanManagerConfigLocation - The location of the resource in the distribution that will be retrieved as a stream using class.getResourceAsStream() to load the databeanmanager config details
Throws:
JaferException

SRWServer

public SRWServer(java.lang.String srwserverConfigLocation,
                 DatabeanManagerFactory factory)
          throws JaferException
The SRWServer is constructed with the databean manager factory that creates a databean manager to process all the search requests. The databean manager will be configured using the supplied factory rather than the config file

Parameters:
srwserverConfigLocation - The location of the resource in the distribution that will be retrieved as a stream using class.getResourceAsStream()
factory - The databean manager factory to use
Throws:
JaferException

SRWServer

public SRWServer(SRWServerConfig srwserverConfig,
                 DatabeanManagerFactoryConfig factoryConfig)
          throws JaferException
The SRWServer is constructed with the databean manager factory that creates a databean manager to process all the search requests. The databean manager will be configured using the supplied factory rather than the config file

Parameters:
srwserverConfig - The srw server config class
factoryConfig - The databean factory config class
Throws:
JaferException
Method Detail

setDatabeanManagerFactory

public void setDatabeanManagerFactory(DatabeanManagerFactory factory)
                               throws JaferException
Allows the databean factory to be updated on the server

Parameters:
factory - the databean factory to use
Throws:
JaferException

createDiagnostic

private gov.loc.www.zing.srw.diagnostic.DiagnosticType createDiagnostic(java.lang.String code,
                                                                        java.lang.String details)
                                                                 throws org.apache.axis.types.URI.MalformedURIException
This method creates a DiagnosticType for the information provided

Parameters:
code - the diagnostic lookup code
details - The diagnotic details
Returns:
The created DiagnosticType
Throws:
org.apache.axis.types.URI.MalformedURIException

validateSearchRetrieveRequest

private boolean validateSearchRetrieveRequest(gov.loc.www.zing.srw.SearchRetrieveRequestType request,
                                              gov.loc.www.zing.srw.SearchRetrieveResponseType response)
                                       throws org.apache.axis.types.URI.MalformedURIException,
                                              JaferException
This method makes sure that the request contains all the required parameters. If it fails the response will be populated with the appropriate diagnostic

Parameters:
request - The SearchRetrieveRequestType request message
response - The SearchRetrieveResponseType response message
Returns:
true if the request is valid otherwise false and diagnostics added to response
Throws:
org.apache.axis.types.URI.MalformedURIException
JaferException

createBasicSearchRetrieveResponse

private gov.loc.www.zing.srw.SearchRetrieveResponseType createBasicSearchRetrieveResponse(gov.loc.www.zing.srw.SearchRetrieveRequestType request)
This method creates a basic response object from the request to be populated with the results of the search and retrieve operaration

Parameters:
request - The request object that must be replecated in the response
Returns:
A basic SearchRetrieveResponseType object that contains the replecated request information

addReplyRecordsToResponse

private void addReplyRecordsToResponse(gov.loc.www.zing.srw.SearchRetrieveRequestType request,
                                       gov.loc.www.zing.srw.SearchRetrieveResponseType response,
                                       DatabeanManager beanManager)
                                throws JaferException
This method adds the requested results to the response according to the request information for startrecord, maxrecords, recordpacking values

Parameters:
request - The SearchRetrieveRequestType request message
response - The SearchRetrieveResponseType response message
beanManager - The bean manager to retrieve results from
Throws:
JaferException

searchRetrieveOperation

public gov.loc.www.zing.srw.SearchRetrieveResponseType searchRetrieveOperation(gov.loc.www.zing.srw.SearchRetrieveRequestType request)
                                                                        throws java.rmi.RemoteException
This method processes a search and retrieve operation

Specified by:
searchRetrieveOperation in interface gov.loc.www.zing.srw.interfaces.SRWPort
Parameters:
request - The search and retrieve request message
Returns:
The search and retrieve response message object
Throws:
java.rmi.RemoteException

scanOperation

public gov.loc.www.zing.srw.ScanResponseType scanOperation(gov.loc.www.zing.srw.ScanRequestType body)
                                                    throws java.rmi.RemoteException
This method processes a scan operation. Currently not supported by this Server class

Specified by:
scanOperation in interface gov.loc.www.zing.srw.interfaces.SRWPort
Parameters:
body - The scan request message
Returns:
The scan response message object
Throws:
java.rmi.RemoteException