public abstract class HarvestDefinitionDAO extends Object implements DAO, Iterable<HarvestDefinition>
Modifier | Constructor and Description |
---|---|
protected |
HarvestDefinitionDAO()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addDomainConfiguration(PartialHarvest hdd,
SparseDomainConfiguration sparseDomainConfiguration)
Add a domainconfiguration to a PartialHarvest.
|
abstract Long |
create(HarvestDefinition harvestDefinition)
Create a harvest definition in persistent storage.
|
abstract boolean |
exists(Long oid)
Check, if there exists a HarvestDefinition identified by a given OID.
|
abstract boolean |
exists(String name)
Check, if there exists a HarvestDefinition identified by a given name.
|
abstract void |
flipActive(SparsePartialHarvest harvestDefinition)
Activates or deactivates a partial harvest definition, depending on its activation status.
|
abstract Iterator<HarvestDefinition> |
getAllHarvestDefinitions()
Get a list of all existing harvest definitions.
|
abstract Iterable<SparseFullHarvest> |
getAllSparseFullHarvestDefinitions()
Get all sparse versions of full harvests for GUI purposes.
|
abstract HarvestDefinition |
getHarvestDefinition(String name)
Get the harvest definition that has the given name, or null, if no harvestdefinition exist with this name.
|
abstract String |
getHarvestName(Long harvestDefinitionID)
Get the name of a harvest given its ID.
|
abstract List<HarvestRunInfo> |
getHarvestRunInfo(long harvestID)
Returns a list with information on the runs of a particular harvest.
|
static HarvestDefinitionDAO |
getInstance()
Creates the singleton.
|
abstract Set<Long> |
getJobIdsForSnapshotDeduplicationIndex(Long harvestId)
Get a collection of jobIds for snapshot deduplication index.
|
abstract List<String> |
getListOfDomainsOfHarvestDefinition(String harvestName)
Get a sorted list of all domainnames of a HarvestDefintion
|
abstract List<String> |
getListOfSeedsOfDomainOfHarvestDefinition(String harvestName,
String domainName)
Get a sorted list of all seeds of a Domain in a HarvestDefinition.
|
abstract Iterable<Long> |
getReadyHarvestDefinitions(Date now)
Get the IDs of the harvest definitions that are ready to run.
|
abstract Iterator<DomainConfiguration> |
getSnapShotConfigurations()
Gets default configurations for all domains.
|
abstract List<SparseDomainConfiguration> |
getSparseDomainConfigurations(Long harvestDefinitionID)
Get all domain,configuration pairs for a harvest definition in sparse version for GUI purposes.
|
abstract SparseFullHarvest |
getSparseFullHarvest(String harvestName)
Get a sparse version of a full harvest for GUI purposes.
|
abstract SparsePartialHarvest |
getSparsePartialHarvest(String harvestName)
Get a sparse version of a partial harvest for GUI purposes.
|
abstract Iterable<SparsePartialHarvest> |
getSparsePartialHarvestDefinitions(boolean excludeInactive)
Get all sparse versions of partial harvests for GUI purposes.
|
abstract boolean |
isSnapshot(Long harvestDefinitionID)
Get whether a given harvest is a snapshot or selective harvest.
|
Iterator<HarvestDefinition> |
iterator()
Get an iterator of all harvest definitions.
|
abstract void |
mapToHarvestChannel(long harvestDefinitionId,
HarvestChannel channel)
Maps a harvest definition to a harvest channel.
|
abstract HarvestDefinition |
read(Long harvestDefinitionID)
Read the stored harvest definition for the given ID.
|
abstract void |
removeDomainConfiguration(Long harvestId,
SparseDomainConfiguration key)
Remove Domain configuration from a specific PartialHarvest.
|
abstract void |
resetDomainConfigurations(PartialHarvest hdd,
List<DomainConfiguration> dcList)
Reset the list of domainconfiguration for a PartialHarvest.
|
abstract void |
setIndexIsReady(Long harvestId,
boolean newValue)
Set the isindexready field available for snapshot harvests.
|
abstract void |
update(HarvestDefinition harvestDefinition)
Update an existing harvest definition with new info in persistent storage.
|
abstract void |
updateNextdate(long harvestId,
Date nextdate)
Update the given PartialHarvest (i.e.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected HarvestDefinitionDAO()
public static HarvestDefinitionDAO getInstance()
IOFailure
- if unable to create the singleton.public abstract Long create(HarvestDefinition harvestDefinition)
harvestDefinition
- A new harvest definition to write out.public abstract HarvestDefinition read(Long harvestDefinitionID) throws UnknownID, IOFailure
harvestDefinitionID
- An ID number for a harvest definitionUnknownID
- if no file with that ID existsIOFailure
- if the File does not exist, does not have the correct ID, or otherwise fails to load correctly.public abstract void update(HarvestDefinition harvestDefinition)
harvestDefinition
- An updated harvest definition object to be persisted.public abstract void flipActive(SparsePartialHarvest harvestDefinition)
harvestDefinition
- the harvest definition objectpublic abstract boolean exists(Long oid)
oid
- a given OIDpublic abstract boolean exists(String name)
name
- a given namepublic abstract Iterator<HarvestDefinition> getAllHarvestDefinitions()
public Iterator<HarvestDefinition> iterator()
iterator
in interface Iterable<HarvestDefinition>
public abstract Iterator<DomainConfiguration> getSnapShotConfigurations()
public abstract Iterable<Long> getReadyHarvestDefinitions(Date now)
now
- public abstract HarvestDefinition getHarvestDefinition(String name)
name
- The name of a harvest definition.public abstract List<HarvestRunInfo> getHarvestRunInfo(long harvestID)
harvestID
- ID of an existing harvestpublic abstract List<SparseDomainConfiguration> getSparseDomainConfigurations(Long harvestDefinitionID)
harvestDefinitionID
- The ID of the harvest definition.ArgumentNotValid
- on null argument.public abstract SparsePartialHarvest getSparsePartialHarvest(String harvestName)
harvestName
- Name of harvest definition.ArgumentNotValid
- on null or empty name.public abstract Iterable<SparsePartialHarvest> getSparsePartialHarvestDefinitions(boolean excludeInactive)
excludeInactive
- If true only active harvest definitions are returned.public abstract SparseFullHarvest getSparseFullHarvest(String harvestName)
harvestName
- Name of harvest definition.ArgumentNotValid
- on null or empty name.public abstract Iterable<SparseFullHarvest> getAllSparseFullHarvestDefinitions()
public abstract String getHarvestName(Long harvestDefinitionID)
harvestDefinitionID
- The ID of a harvestArgumentNotValid
- on null argumentUnknownID
- if no harvest has the given ID.IOFailure
- on any other error talking to the databasepublic abstract boolean isSnapshot(Long harvestDefinitionID)
harvestDefinitionID
- ID of a harvestArgumentNotValid
- on null argumentUnknownID
- if no harvest has the given ID.IOFailure
- on any other error talking to the databasepublic abstract List<String> getListOfDomainsOfHarvestDefinition(String harvestName)
harvestName
- of HarvestDefintionArgumentNotValid
- on null argumentIOFailure
- on any other error talking to the databasepublic abstract List<String> getListOfSeedsOfDomainOfHarvestDefinition(String harvestName, String domainName)
harvestName
- of HarvestDefintiondomainName
- of DomainArgumentNotValid
- on null argumentIOFailure
- on any other error talking to the databasepublic abstract Set<Long> getJobIdsForSnapshotDeduplicationIndex(Long harvestId)
harvestId
- the id of the harvestpublic abstract void setIndexIsReady(Long harvestId, boolean newValue)
harvestId
- the ID of the harvest.newValue
- the new isindexready valuepublic abstract void removeDomainConfiguration(Long harvestId, SparseDomainConfiguration key)
harvestId
- Id for a specific PartialHarvestkey
- a SparseDomainConfiguration uniquely identifying the domainconfig.public abstract void updateNextdate(long harvestId, Date nextdate)
harvestId
- A given PartialHarvest id (i.e. Selective Harvest).nextdate
- A new date for the next harvest run.public abstract void addDomainConfiguration(PartialHarvest hdd, SparseDomainConfiguration sparseDomainConfiguration)
hdd
- a given PartialHarvestsparseDomainConfiguration
- a reduced domainconfiguration objectpublic abstract void resetDomainConfigurations(PartialHarvest hdd, List<DomainConfiguration> dcList)
hdd
- a given PartialHarvestdcList
- the new list of domainconfigurationspublic abstract void mapToHarvestChannel(long harvestDefinitionId, HarvestChannel channel)
harvestDefinitionId
- the harvest definition idchannel
- the harvest channelCopyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.