Esri Geoportal Server
1.0

com.esri.gpt.control.webharvest.engine
Class Harvester

java.lang.Object
  extended by com.esri.gpt.control.webharvest.engine.Harvester
All Implemented Interfaces:
HarvesterMBean

public class Harvester
extends Object
implements HarvesterMBean

Harvesting engine.


Nested Class Summary
static interface Harvester.Listener
          Listener of events.
 
Constructor Summary
Harvester(MessageBroker messageBroker, HarvesterConfiguration cfg)
          Creates instance of the engine.
 
Method Summary
 boolean cancel(RequestContext context, String uuid)
          Cancels pending tasks for given repository.
protected  void finalize()
           
 int getPoolSize()
          Gets pool size.
 boolean getRunning()
          Checks if synchronizer is running.
 Statistics getStatistics(String uuid)
          Gets statistics for given repository.
 void init()
          Initializes engine.
 boolean isExecutingLocally(String uuid)
          Checks if is executing locally.
 void registerListener(Harvester.Listener listener)
          Registers listener.
 void removeAllListeners()
          Removes all listeners.
 void reselect()
          Reselects harvesting sites.
 void setPoolSize(int size)
          Sets pool size.
 void shutdown()
          Shuts down harvesting engine.
 boolean span(RequestContext context, HrRecord resource, Integer maxRecs, Date fromDate)
          Spans new, separate thread exclusively for the resource.
 void startup()
          Startups synchronizer.
 boolean submit(RequestContext context, HrRecord resource, Integer maxRecs, Date fromDate)
          Submits new harvesting task for partial harvest.
 void unregisterListener(Harvester.Listener listener)
          Removes listener.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Harvester

public Harvester(MessageBroker messageBroker,
                 HarvesterConfiguration cfg)
Creates instance of the engine.

Parameters:
messageBroker - message broker
cfg - harvest configuration
Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

startup

public void startup()
Description copied from interface: HarvesterMBean
Startups synchronizer.

Specified by:
startup in interface HarvesterMBean

init

public void init()
Initializes engine.


getRunning

public boolean getRunning()
Description copied from interface: HarvesterMBean
Checks if synchronizer is running.

Specified by:
getRunning in interface HarvesterMBean
Returns:
true if synchronizer is running

shutdown

public void shutdown()
Shuts down harvesting engine.

Specified by:
shutdown in interface HarvesterMBean

setPoolSize

public void setPoolSize(int size)
Description copied from interface: HarvesterMBean
Sets pool size.

Specified by:
setPoolSize in interface HarvesterMBean
Parameters:
size - desired pool size

getPoolSize

public int getPoolSize()
Description copied from interface: HarvesterMBean
Gets pool size.

Specified by:
getPoolSize in interface HarvesterMBean
Returns:
pool size

reselect

public void reselect()
Reselects harvesting sites.


isExecutingLocally

public boolean isExecutingLocally(String uuid)
Checks if is executing locally.

Parameters:
uuid - resource UUID
Returns:
true if is executing locally

getStatistics

public Statistics getStatistics(String uuid)
Gets statistics for given repository.

Parameters:
uuid - repository uuid.
Returns:
statistics or null if statistics unavailable

submit

public boolean submit(RequestContext context,
                      HrRecord resource,
                      Integer maxRecs,
                      Date fromDate)
Submits new harvesting task for partial harvest.

Parameters:
context - request context
resource - resource to harvest
maxRecs - maximum number of records to harvest (null for no maximum limit)
fromDate - to harvest only from the specific date (null for no from date)
Returns:
true if task has been submitted

span

public boolean span(RequestContext context,
                    HrRecord resource,
                    Integer maxRecs,
                    Date fromDate)
Spans new, separate thread exclusively for the resource.

Parameters:
context - request context
resource - resource to harvest
maxRecs - maximum number of records to harvest (null for no maximum limit)
fromDate - to harvest only from the specific date (null for no from date)
Returns:
true if task has been sumbited

cancel

public boolean cancel(RequestContext context,
                      String uuid)
Cancels pending tasks for given repository.

Parameters:
context - request context
uuid - repository uuid
Returns:
true if has been canceled properly

registerListener

public void registerListener(Harvester.Listener listener)
Registers listener.

Parameters:
listener - listener

unregisterListener

public void unregisterListener(Harvester.Listener listener)
Removes listener.

Parameters:
listener - listener

removeAllListeners

public void removeAllListeners()
Removes all listeners.


Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.