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

org.deegree.ogcwebservices.csw.manager
Class AbstractHarvester

java.lang.Object
  extended by java.util.TimerTask
      extended by org.deegree.ogcwebservices.csw.manager.AbstractHarvester
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
CatalogueHarvester, CSWProfileHarvester, ServiceHarvester

public abstract class AbstractHarvester
extends TimerTask

Abstract super class of all CS-W harvesters. For each kind of source a specialized harvester shall be implemented. A concrete implementation of AbstractHarvester will be called within a timer loop.

Since:
2.0
Version:
$Revision: 19475 $, 1.0. $Revision: 19475 $, $Date: 2009-09-02 14:51:48 +0200 (Mi, 02. Sep 2009) $
Author:
Andreas Poth, last edited by: $Author: lbuesching $

Nested Class Summary
protected  class AbstractHarvester.AbstractHarvestProcessor
          abstract super class for all harvest processores
 
Field Summary
protected  List<URI> inProgress
           
protected static NamespaceContext nsc
           
protected  String version
           
 
Constructor Summary
protected AbstractHarvester(String version)
           
 
Method Summary
 void addRequest(Harvest request)
          adds a request to the harvesting process
protected  String getIdentifierXPath(XMLFragment metaData)
          returns the XPath the metadata records identifier
protected  String getIdentifierXPathForUpdate(XMLFragment metaData)
          returns the XPath the metadata records identifier
protected  void informResponseHandlers(URI source)
          informs all response handlers assigend to a source about successful harvesting of the source
protected  void informResponseHandlers(URI source, Throwable e)
          informs all response handlers assigend to a source about an exception that occurs when harvesting a source
 boolean isRunning()
          returns true if the harvesting process is running
 void removeRequest(Harvest request)
          removes a request from the harvesting request.
protected  boolean shallHarvest(URI source, HarvestRepository.ResourceType targetType)
          returns true if the passed source shall be harvested. this is true if a source has not been harvested before or the next harvesting timestamp has been reached and the source is of type
 void startHarvesting()
          starts the harvesting process
 void stopHarvesting()
          stops the harvesting process
 
Methods inherited from class java.util.TimerTask
cancel, run, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inProgress

protected List<URI> inProgress

version

protected String version

nsc

protected static NamespaceContext nsc
Constructor Detail

AbstractHarvester

protected AbstractHarvester(String version)
Parameters:
version - the version of the CSW
Method Detail

addRequest

public void addRequest(Harvest request)
                throws IOException,
                       DBPoolException,
                       SQLException
adds a request to the harvesting process

Parameters:
request -
Throws:
IOException
SQLException
DBPoolException

isRunning

public boolean isRunning()
returns true if the harvesting process is running

Returns:
true if the harvesting process is running

removeRequest

public void removeRequest(Harvest request)
                   throws IOException,
                          DBPoolException,
                          SQLException
removes a request from the harvesting request.

!! At the moment the OGC CSW does not know a mechanism/request to stop a cyclic harvesting job, so this method can not be called with a standard OGC OWS request !!

Parameters:
request -
Throws:
IOException
SQLException
DBPoolException

startHarvesting

public void startHarvesting()
starts the harvesting process


stopHarvesting

public void stopHarvesting()
stops the harvesting process


informResponseHandlers

protected void informResponseHandlers(URI source)
                               throws IOException,
                                      DBPoolException,
                                      SQLException,
                                      URISyntaxException
informs all response handlers assigend to a source about successful harvesting of the source

Parameters:
source -
Throws:
URISyntaxException
SQLException
DBPoolException
MalformedURLException
IOException

shallHarvest

protected boolean shallHarvest(URI source,
                               HarvestRepository.ResourceType targetType)
                        throws IOException,
                               DBPoolException,
                               SQLException
returns true if the passed source shall be harvested. this is true if a source has not been harvested before or the next harvesting timestamp has been reached and the source is of type

Parameters:
source -
Returns:
true if the passed source shall be harvested
Throws:
DBPoolException
SQLException
IOException
See Also:
service

informResponseHandlers

protected void informResponseHandlers(URI source,
                                      Throwable e)
                               throws IOException,
                                      DBPoolException,
                                      SQLException,
                                      URISyntaxException
informs all response handlers assigend to a source about an exception that occurs when harvesting a source

Parameters:
source -
e -
Throws:
URISyntaxException
SQLException
DBPoolException
IOException

getIdentifierXPath

protected String getIdentifierXPath(XMLFragment metaData)
returns the XPath the metadata records identifier

Parameters:
metaData -
Returns:
the XPath the metadata records identifier

getIdentifierXPathForUpdate

protected String getIdentifierXPathForUpdate(XMLFragment metaData)
returns the XPath the metadata records identifier

Parameters:
metaData -
Returns:
the XPath the metadata records identifier

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