deegree 2.5 (2011/06/29 09:44 build-8-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:
java.io.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(java.lang.String version, java.lang.String id, java.util.Map<java.lang.String,java.lang.String> vendorSpecificParameter, java.net.URI source, java.net.URI resourceType, java.lang.String resourceFormat, TimeDuration harvestTimeDuration, java.util.List<java.net.URI> responseHandler, java.util.Date startTimestamp)
           
 
Method Summary
static Harvest create(java.util.Map<java.lang.String,java.lang.String> param)
          factory method for creating a Harvest request from its KVP representation
static Transaction create(java.lang.String id, org.w3c.dom.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.
 java.lang.String getResourceFormat()
          The ResourceFormat paramter is used to indicate the encoding used for the resource being harvested.
 java.net.URI getResourceType()
          The ResourceType parameter is a reference to a schema document that defines the structure of the resource being harvested.
 java.util.List<java.net.URI> getResponseHandler()
           The ResponseHandler parameter is a flag that indicates how the Harvest operation should be processed by a CSW server.
 java.lang.String getServiceName()
          will always return 'CSW'
 java.net.URI getSource()
          The Source parameter is used to specify a URI reference to the metadata resource to be harvested.
 java.util.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(java.lang.String version,
        java.lang.String id,
        java.util.Map<java.lang.String,java.lang.String> vendorSpecificParameter,
        java.net.URI source,
        java.net.URI resourceType,
        java.lang.String resourceFormat,
        TimeDuration harvestTimeDuration,
        java.util.List<java.net.URI> responseHandler,
        java.util.Date startTimestamp)
Parameters:
version -
id -
vendorSpecificParameter -
source -
resourceType -
resourceFormat -
harvestTimeDuration -
responseHandler -
Method Detail

create

public static Harvest create(java.util.Map<java.lang.String,java.lang.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(java.lang.String id,
                                       org.w3c.dom.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 java.lang.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 java.net.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 java.util.List<java.net.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 java.net.URI getSource()
The Source parameter is used to specify a URI reference to the metadata resource to be harvested.

Returns:
the uri

getStartTimestamp

public java.util.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 java.lang.String getServiceName()
will always return 'CSW'

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

deegree 2.5 (2011/06/29 09:44 build-8-official)

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