project.biota.biotaInterface
Class BiotaWebRequestHandler

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

public class BiotaWebRequestHandler
extends BiotaRequestHandler

BiotaWebRequestHandler handles requests for resources served via a Biota onboard Web 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
BiotaWebRequestHandler(DiGIRRequestParser parser)
          Constructs a BiotaWebRequestHandler to handle a DiGIR request.
 
Method Summary
protected  void buildDiGIRResult(String filterString)
          Makes database queries to a Biota onboard Web Server via a HTTP 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

BiotaWebRequestHandler

public BiotaWebRequestHandler(DiGIRRequestParser parser)
Constructs a BiotaWebRequestHandler 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 Biota onboard Web Server via a HTTP 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 HTTP query into the Biota onboard Web Server to find the number of records and the date it's last updated and calls the ResourceObject.setNumberOfRecords() method and the ResourceObject.setDateLastUpdated() method of the specified 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 parameter fieldsValues object is a java.util.List that holds the values for the required fields. The order of the list is the same as the order of fields in the parameters to the HTTP POST method. Therefore, it is important to keep it in a java.util.List instead of a java.util.Set.

It calls the 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.