project.biota.biotaInterface
Class BiotaServerRequestHandler

java.lang.Object
  extended byproject.biota.biotaInterface.BiotaRequestHandler
      extended byproject.biota.biotaInterface.BiotaServerRequestHandler

public class BiotaServerRequestHandler
extends BiotaRequestHandler

BiotaServerRequestHandler handles requests for resources served via a 4D Server.

Author:
Kimmy Lin
See Also:
BiotaRequestHandler

Field Summary
 
Fields inherited from class project.biota.biotaInterface.BiotaRequestHandler
conceptualSchemaNamespace, conceptualSchemaURI, formatter, left_index, logger, maxDepth, maxlevel, requestParser, requiredConcepts, requiredTablesFields, responseRecords, right_index, rscObject
 
Constructor Summary
BiotaServerRequestHandler(DiGIRRequestParser parser)
          Constructs a BiotaServerRequestHandler to handle a DiGIR request.
 
Method Summary
protected  void buildDiGIRResult(String filterString)
          Makes database queries to a 4D Server via a JDBC connection and processes the response returned by the database to build the records for the DiGIR response.
protected  String getConceptValue(String conceptName, Object fieldsValues)
          Constructs the value for a schema concept from the fieldsValues object.
protected  void updateResourceMetadata(ResourceObject rscObj)
          Updates the metadata for the resource specified by the ResourceObject object.
 
Methods inherited from class project.biota.biotaInterface.BiotaRequestHandler
addRecordConceptElem, buildResult, createInventoryResponseElem, findRequiredTablesFields, getQueryString, parseValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BiotaServerRequestHandler

public BiotaServerRequestHandler(DiGIRRequestParser parser)
Constructs a BiotaServerRequestHandler to handle a DiGIR request.

Parameters:
parser - the DiGIRRequestParser that parses the DiGIR request
Method Detail

buildDiGIRResult

protected void buildDiGIRResult(String filterString)
Makes database queries to a 4D Server via a JDBC connection and processes the response returned by the database to build the records for the DiGIR response.

Specified by:
buildDiGIRResult in class BiotaRequestHandler
Parameters:
filterString - the string representation of the filter in the DiGIR request

updateResourceMetadata

protected void updateResourceMetadata(ResourceObject rscObj)
Updates the metadata for the resource specified by the ResourceObject object. It makes a SQL query, via a JDBC bridge, for the primary key and the database field SpcmRecChangedDate in the resource's main table. It then counts the number of rows in the ResultSet object returned and set the number of records by calling ResourceObject.setNumberOfRecords() method of the specified ResourceObject object.

For the resource's last-updated date, it converts the values of the field SpcmRecChangedDate to a java.uitl.Date object to find the latest of them all and calls ResourceObject.setDateLastUpdated() method of the ResourceObject object.

Specified by:
updateResourceMetadata in class BiotaRequestHandler
Parameters:
rscObj - the ResourceObject object that represents a resource
See Also:
ResourceObject.setNumberOfRecords(int), ResourceObject.setDateLastUpdated(String)

getConceptValue

protected String getConceptValue(String conceptName,
                                 Object fieldsValues)
Constructs the value for a schema concept from the fieldsValues object. The fieldsValues object is a java.util.Map that holds mapping between field names to field values for a record. It calls parseValue() method when a field needs parsing.

Specified by:
getConceptValue in class BiotaRequestHandler
Parameters:
conceptName - the name for the schema concept
fieldsValues - a collection of field values for one record
Returns:
the value for the schema concept for a record
See Also:
BiotaRequestHandler.parseValue(Field, String)


Copyright © 2004 University of Massachusetts at Boston. All Rights Reserved.