org.gcube.data.speciesplugin
Class SpeciesLifecycle

java.lang.Object
  extended by org.gcube.data.tmf.impl.LifecycleAdapter
      extended by org.gcube.data.speciesplugin.SpeciesLifecycle
All Implemented Interfaces:
Serializable, org.gcube.data.tmf.api.SourceLifecycle

public class SpeciesLifecycle
extends org.gcube.data.tmf.impl.LifecycleAdapter

Author:
"Federico De Faveri defaveri@isti.cnr.it", "Valentina Marioli valentina.marioli@isti.cnr.it"
See Also:
Serialized Form

Field Summary
protected  List<String> datasources
           
protected static org.gcube.data.speciesplugin.requests.RequestBinder db
           
protected  long lastUpdate
           
protected  ScheduledFuture<?> scheduled
           
protected  List<String> scientificNames
           
static String STORAGE_LOCATION
          The storage location.
protected  boolean strictMatch
           
protected  TimeUnit timeUnit
           
protected  long updatePeriod
           
 
Constructor Summary
SpeciesLifecycle(SpeciesSource source, List<String> scientificNames, List<String> datasources, boolean strictMatch, long updatePeriod, TimeUnit timeUnit)
          Creates an instance for a given SpeciesSource
 
Method Summary
protected  long calculateInitialRefreshDelay()
           
 void init()
          
protected  void loadCollection()
           
 void reconfigure(Element DOMRequest)
          
protected  void refreshCollection()
           
protected  void rescheduleRefresh()
           
protected  void scheduleRefresh()
           
 void stop()
          
 void terminate()
          
protected  void unscheduleRefresh()
           
 
Methods inherited from class org.gcube.data.tmf.impl.LifecycleAdapter
resume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STORAGE_LOCATION

public static final String STORAGE_LOCATION
The storage location.

See Also:
Constant Field Values

db

protected static org.gcube.data.speciesplugin.requests.RequestBinder db

scientificNames

protected List<String> scientificNames

datasources

protected List<String> datasources

strictMatch

protected boolean strictMatch

lastUpdate

protected long lastUpdate

scheduled

protected transient ScheduledFuture<?> scheduled

updatePeriod

protected long updatePeriod

timeUnit

protected TimeUnit timeUnit
Constructor Detail

SpeciesLifecycle

public SpeciesLifecycle(SpeciesSource source,
                        List<String> scientificNames,
                        List<String> datasources,
                        boolean strictMatch,
                        long updatePeriod,
                        TimeUnit timeUnit)
Creates an instance for a given SpeciesSource

Parameters:
source - the source
Method Detail

init

public void init()
          throws Exception

Specified by:
init in interface org.gcube.data.tmf.api.SourceLifecycle
Overrides:
init in class org.gcube.data.tmf.impl.LifecycleAdapter
Throws:
Exception

scheduleRefresh

protected void scheduleRefresh()

calculateInitialRefreshDelay

protected long calculateInitialRefreshDelay()

rescheduleRefresh

protected void rescheduleRefresh()

refreshCollection

protected void refreshCollection()

loadCollection

protected void loadCollection()
                       throws Exception
Throws:
Exception

reconfigure

public void reconfigure(Element DOMRequest)
                 throws org.gcube.common.clients.exceptions.InvalidRequestException

Specified by:
reconfigure in interface org.gcube.data.tmf.api.SourceLifecycle
Overrides:
reconfigure in class org.gcube.data.tmf.impl.LifecycleAdapter
Throws:
org.gcube.common.clients.exceptions.InvalidRequestException

terminate

public void terminate()

Specified by:
terminate in interface org.gcube.data.tmf.api.SourceLifecycle
Overrides:
terminate in class org.gcube.data.tmf.impl.LifecycleAdapter

stop

public void stop()

Specified by:
stop in interface org.gcube.data.tmf.api.SourceLifecycle
Overrides:
stop in class org.gcube.data.tmf.impl.LifecycleAdapter

unscheduleRefresh

protected void unscheduleRefresh()


Copyright © 2014. All Rights Reserved.