deegree 2.5 (2011/06/29 09:44 build-8-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:
java.lang.Runnable
Direct Known Subclasses:
CatalogueHarvester, CSWProfileHarvester, ServiceHarvester

public abstract class AbstractHarvester
extends java.util.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: 21672 $, 1.0. $Revision: 21672 $, $Date: 2009-12-29 09:44:20 +0100 (Di, 29 Dez 2009) $
Author:
Andreas Poth, last edited by: $Author: apoth $

Nested Class Summary
protected  class AbstractHarvester.AbstractHarvestProcessor
          abstract super class for all harvest processores
 
Field Summary
protected  java.util.List<java.net.URI> inProgress
           
protected static NamespaceContext nsc
           
protected  java.lang.String version
           
 
Constructor Summary
protected AbstractHarvester(java.lang.String version)
           
 
Method Summary
 void addRequest(Harvest request)
          adds a request to the harvesting process
protected  java.lang.String getIdentifierXPath(XMLFragment metaData)
          returns the XPath the metadata records identifier
protected  java.lang.String getIdentifierXPathForUpdate(XMLFragment metaData)
          returns the XPath the metadata records identifier
protected  void informResponseHandlers(java.net.URI source)
          informs all response handlers assigend to a source about successful harvesting of the source
protected  void informResponseHandlers(java.net.URI source, java.lang.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(java.net.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 java.util.List<java.net.URI> inProgress

version

protected java.lang.String version

nsc

protected static NamespaceContext nsc
Constructor Detail

AbstractHarvester

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

addRequest

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

Parameters:
request -
Throws:
java.io.IOException
java.sql.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 java.io.IOException,
                          DBPoolException,
                          java.sql.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:
java.io.IOException
java.sql.SQLException
DBPoolException

startHarvesting

public void startHarvesting()
starts the harvesting process


stopHarvesting

public void stopHarvesting()
stops the harvesting process


informResponseHandlers

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

Parameters:
source -
Throws:
java.net.URISyntaxException
java.sql.SQLException
DBPoolException
java.net.MalformedURLException
java.io.IOException

shallHarvest

protected boolean shallHarvest(java.net.URI source,
                               HarvestRepository.ResourceType targetType)
                        throws java.io.IOException,
                               DBPoolException,
                               java.sql.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
java.sql.SQLException
java.io.IOException
See Also:
service

informResponseHandlers

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

Parameters:
source -
e -
Throws:
java.net.URISyntaxException
java.sql.SQLException
DBPoolException
java.io.IOException

getIdentifierXPath

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

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

getIdentifierXPathForUpdate

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

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

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