deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.ogcwebservices.csw.manager
Class Harvest

java.lang.Object
  extended by org.deegree.ogcwebservices.AbstractOGCWebServiceRequest
      extended by org.deegree.ogcwebservices.csw.manager.Harvest
All Implemented Interfaces:
Serializable, OGCWebServiceRequest

public class Harvest
extends AbstractOGCWebServiceRequest

The general model defines two operations in the Manager class that may be used to create or update records in the catalogue. They are the transaction operation and the harvestRecords operation. The transaction operation may be used to "push" data into the catalogue and is defined in Subclause 10.11. of CS-W specification. This subclause defines the optional Harvest operation, which is an operation that "pulls" data into the catalogue. That is, this operation only references the data to be inserted or updated in the catalogue, and it is the job of the catalogue service to resolve the reference, fetch that data, and process it into the catalogue.

The Harvest operation had two modes of operation, controlled by a flag in the request. The first mode of operation is a synchronous mode in whice the CSW receives a Harvest request from the client, processes it immediately, and sends the results to the client while the client waits. The second mode of operation is asynchronous in that the server receives a Harvest request from the client, and sends the client an immediate acknowledgement that the request has been successfully received. The server can then process the Harvest request whenever it likes, taking as much time as is required and then send the results of the processing to a URI specified in the original Harvest request. This latter mode of operation is included to support Harvest requests that could run for a period of time longer than most HTTP timeout’s will allow.

Processing a Harvest request means that the CSW resolves the URI pointing to the metadata resource, parses the resource, and then creates or modifies metadata records in the catalogue in order to register the resource. This operation may be performed only once or periodically depending on how the client invokes the operation.

Since:
2.0
Version:
$Revision: 18195 $, 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $
See Also:
Serialized Form

Constructor Summary
Harvest(String version, String id, Map<String,String> vendorSpecificParameter, URI source, URI resourceType, String resourceFormat, TimeDuration harvestTimeDuration, List<URI> responseHandler, Date startTimestamp)
           
 
Method Summary
static Harvest create(Map<String,String> param)
          factory method for creating a Harvest request from its KVP representation
static Transaction create(String id, Element transRoot)
          creates a Harvesting Request from its XM representation
 TimeDuration getHarvestInterval()
           The HarvestTimeDuration parameter is used to specify the period of time, in ISO 8601 period format, that should elapse before a CSW attempts to re-harvest the specified resource thus refreshing it copy of a resource.
 String getResourceFormat()
          The ResourceFormat paramter is used to indicate the encoding used for the resource being harvested.
 URI getResourceType()
          The ResourceType parameter is a reference to a schema document that defines the structure of the resource being harvested.
 List<URI> getResponseHandler()
           The ResponseHandler parameter is a flag that indicates how the Harvest operation should be processed by a CSW server.
 String getServiceName()
          will always return 'CSW'
 URI getSource()
          The Source parameter is used to specify a URI reference to the metadata resource to be harvested.
 Date getStartTimestamp()
          returns the deegree specific timestamp when harvesting shall start.
 
Methods inherited from class org.deegree.ogcwebservices.AbstractOGCWebServiceRequest
getId, getParam, getParamAsInt, getParamValues, getRequestParameter, getRequiredParam, getVendorSpecificParameter, getVendorSpecificParameters, getVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Harvest

Harvest(String version,
        String id,
        Map<String,String> vendorSpecificParameter,
        URI source,
        URI resourceType,
        String resourceFormat,
        TimeDuration harvestTimeDuration,
        List<URI> responseHandler,
        Date startTimestamp)
Parameters:
version -
id -
vendorSpecificParameter -
source -
resourceType -
resourceFormat -
harvestTimeDuration -
responseHandler -
Method Detail

create

public static Harvest create(Map<String,String> param)
                      throws InvalidParameterValueException,
                             MissingParameterValueException
factory method for creating a Harvest request from its KVP representation

Parameters:
param -
Returns:
the harvest
Throws:
InvalidParameterValueException
MissingParameterValueException

create

public static final Transaction create(String id,
                                       Element transRoot)
                                throws XMLParsingException
creates a Harvesting Request from its XM representation

Parameters:
id -
transRoot -
Returns:
the new transaction
Throws:
XMLParsingException

getHarvestInterval

public TimeDuration getHarvestInterval()

The HarvestTimeDuration parameter is used to specify the period of time, in ISO 8601 period format, that should elapse before a CSW attempts to re-harvest the specified resource thus refreshing it copy of a resource.

If no HarvestTimeDuration parameter is specified then the resource is harvested only once in response to the Harvest request.

Returns:
the interval

getResourceFormat

public String getResourceFormat()
The ResourceFormat paramter is used to indicate the encoding used for the resource being harvested. This parameter is included to support the harvesting of metadata resources available in various formats such as plain text, XML or HTML. The values of this parameter must be a MIME type. If the parameter is not specified then the default value of text/xml should be assumed.

Returns:
the format

getResourceType

public URI getResourceType()
The ResourceType parameter is a reference to a schema document that defines the structure of the resource being harvested. This is an optional parameter and if it not specified then the catalogue must employee other means to determine the type of resource being harvested. For example, the catalogue may use schema references in the input document to determine the resource type, or perhaps parse the root element to determine the type of metadata being harvested (e.g. <fgdc:metadata> is the root element of an FGDC document).

Returns:
the uri

getResponseHandler

public List<URI> getResponseHandler()

The ResponseHandler parameter is a flag that indicates how the Harvest operation should be processed by a CSW server.

If the parameter is not present, then the Harvest operation is processed synchronously meaning that the client sends the Harvest request to a CSW and then waits to receive a HarvestResponse or exception message. The CSW immediately processes the Harvest request, while the client waits for a response. The problem with this mode of operation is that the client may timeout waiting for the server to process the request.

If the parameter is present, the Harvest operation is processed asynchronously. In this case, the server responds immediately to a client’s request with an acknowledgement message. The acknowlegment message echos the client’s request, using the <EchoedRequest> element, and may include an optionally generated request identifier using the <RequestId> element. The acknowledgement message tells the client that the request has been received and notification of completion will be send to the URL specified as the value of the ResponseHandler parameter. The Harvest request may then be processed at some later time taking as much time as is required to complete the operation. When the operation is completed, a HarvestResponse message or exception message (if a problem was encountered) is sent to the URL specified as the value of the ResponseHandler parameter.

Returns:
the list of uris

getSource

public URI getSource()
The Source parameter is used to specify a URI reference to the metadata resource to be harvested.

Returns:
the uri

getStartTimestamp

public Date getStartTimestamp()
returns the deegree specific timestamp when harvesting shall start. If null is returned harvesting shall start as soon as possible

Returns:
the date

getServiceName

public String getServiceName()
will always return 'CSW'

Returns:
the name of the service that is targeted by the request

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org