public class HarvestDefinitionDBDAO extends HarvestDefinitionDAO
The statements to create the tables are located in:
Modifier and Type | Method and Description |
---|---|
void |
addDomainConfiguration(PartialHarvest ph,
SparseDomainConfiguration dcKey)
Add a domainconfiguration to a PartialHarvest.
|
Long |
create(HarvestDefinition harvestDefinition)
Create a harvest definition in Database.
|
boolean |
exists(Long oid)
Check, if there exists a HarvestDefinition identified by a given OID.
|
boolean |
exists(String name)
Check, if there exists a HarvestDefinition identified by a given name.
|
void |
flipActive(SparsePartialHarvest harvestDefinition)
Activates or deactivates a partial harvest definition.
|
Iterator<HarvestDefinition> |
getAllHarvestDefinitions()
Get a list of all existing harvest definitions ordered by name.
|
Iterable<SparseFullHarvest> |
getAllSparseFullHarvestDefinitions()
Get all sparse versions of full harvests for GUI purposes.
|
HarvestDefinition |
getHarvestDefinition(String name)
Get the harvest definition that has the given name, if any.
|
String |
getHarvestName(Long harvestDefinitionID)
Get the name of a harvest given its ID.
|
List<HarvestRunInfo> |
getHarvestRunInfo(long harvestID)
Returns a list with information on the runs of a particular harvest.
|
Set<Long> |
getJobIdsForSnapshotDeduplicationIndex(Long harvestId)
Get a collection of jobIds for snapshot deduplication index.
|
List<String> |
getListOfDomainsOfHarvestDefinition(String harvestName)
Get a sorted list of all domain names of a HarvestDefinition.
|
List<String> |
getListOfSeedsOfDomainOfHarvestDefinition(String harvestName,
String domainName)
Get a sorted list of all seeds of a Domain in a HarvestDefinition.
|
Iterable<Long> |
getReadyHarvestDefinitions(Date now)
Returns a list of IDs of harvest definitions that are ready to be scheduled.
|
Iterator<DomainConfiguration> |
getSnapShotConfigurations()
Gets default configurations for all domains that are not aliases.
|
List<SparseDomainConfiguration> |
getSparseDomainConfigurations(Long harvestDefinitionID)
Get all domain,configuration pairs for a harvest definition in sparse version for GUI purposes.
|
SparseFullHarvest |
getSparseFullHarvest(String harvestName)
Get a sparse version of a full harvest for GUI purposes.
|
SparsePartialHarvest |
getSparsePartialHarvest(String harvestName)
Get a sparse version of a partial harvest for GUI purposes.
|
Iterable<SparsePartialHarvest> |
getSparsePartialHarvestDefinitions(boolean excludeInactive)
Get all sparse versions of partial harvests for GUI purposes ordered by name.
|
boolean |
isSnapshot(Long harvestDefinitionID)
Get whether a given harvest is a snapshot or selective harvest.
|
void |
mapToHarvestChannel(long harvestDefinitionId,
HarvestChannel channel)
Maps a harvest definition to a harvest channel.
|
HarvestDefinition |
read(Long harvestDefinitionID)
Read the stored harvest definition for the given ID.
|
void |
removeDomainConfiguration(Long harvestId,
SparseDomainConfiguration key)
Remove Domain configuration from a specific PartialHarvest.
|
void |
resetDomainConfigurations(PartialHarvest ph,
List<DomainConfiguration> dcList)
Reset the list of domainconfiguration for a PartialHarvest.
|
void |
setIndexIsReady(Long harvestId,
boolean newValue)
Set the isindexready field available for snapshot harvests.
|
void |
update(HarvestDefinition hd)
Update an existing harvest definition with new info.
|
void |
updateNextdate(long harvestId,
Date nextdate)
Update the given PartialHarvest (i.e.
|
getInstance, iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public Long create(HarvestDefinition harvestDefinition)
create
in class HarvestDefinitionDAO
harvestDefinition
- A new harvest definition to store in the database.HarvestDefinitionDAO.create(HarvestDefinition)
public HarvestDefinition read(Long harvestDefinitionID) throws UnknownID, IOFailure
read
in class HarvestDefinitionDAO
harvestDefinitionID
- An ID number for a harvest definitionUnknownID
- if no entry with that ID exists in the databaseIOFailure
- If DB-failure occurs?HarvestDefinitionDAO.read(Long)
public void update(HarvestDefinition hd)
update
in class HarvestDefinitionDAO
hd
- An updated harvest definitionHarvestDefinitionDAO.update(HarvestDefinition)
public void flipActive(SparsePartialHarvest harvestDefinition)
flipActive
in class HarvestDefinitionDAO
harvestDefinition
- the harvest definition object.public boolean exists(String name)
HarvestDefinitionDAO
exists
in class HarvestDefinitionDAO
name
- a given namepublic boolean exists(Long oid)
HarvestDefinitionDAO
exists
in class HarvestDefinitionDAO
oid
- a given OIDpublic Iterator<HarvestDefinition> getAllHarvestDefinitions()
getAllHarvestDefinitions
in class HarvestDefinitionDAO
public Iterator<DomainConfiguration> getSnapShotConfigurations()
This method currently gives an iterator that reads in all domains, although only on demand, that is: when calling "hasNext".
getSnapShotConfigurations
in class HarvestDefinitionDAO
public Iterable<Long> getReadyHarvestDefinitions(Date now)
getReadyHarvestDefinitions
in class HarvestDefinitionDAO
now
- The current datepublic HarvestDefinition getHarvestDefinition(String name)
getHarvestDefinition
in class HarvestDefinitionDAO
name
- The name of a harvest definition.public List<HarvestRunInfo> getHarvestRunInfo(long harvestID)
HarvestDefinitionDAO
getHarvestRunInfo
in class HarvestDefinitionDAO
harvestID
- ID of an existing harvestpublic List<SparseDomainConfiguration> getSparseDomainConfigurations(Long harvestDefinitionID)
getSparseDomainConfigurations
in class HarvestDefinitionDAO
harvestDefinitionID
- The ID of the harvest definition.ArgumentNotValid
- on null argument.public Iterable<SparsePartialHarvest> getSparsePartialHarvestDefinitions(boolean excludeInactive)
getSparsePartialHarvestDefinitions
in class HarvestDefinitionDAO
excludeInactive
- If true only active harvest definitions are returned.public SparsePartialHarvest getSparsePartialHarvest(String harvestName)
getSparsePartialHarvest
in class HarvestDefinitionDAO
harvestName
- Name of harvest definition.ArgumentNotValid
- on null or empty name.public Iterable<SparseFullHarvest> getAllSparseFullHarvestDefinitions()
getAllSparseFullHarvestDefinitions
in class HarvestDefinitionDAO
public String getHarvestName(Long harvestDefinitionID)
getHarvestName
in class HarvestDefinitionDAO
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 boolean isSnapshot(Long harvestDefinitionID)
isSnapshot
in class HarvestDefinitionDAO
harvestDefinitionID
- ID of a harvestArgumentNotValid
- on null argumentUnknownID
- if no harvest has the given ID.public SparseFullHarvest getSparseFullHarvest(String harvestName)
getSparseFullHarvest
in class HarvestDefinitionDAO
harvestName
- Name of harvest definition.ArgumentNotValid
- on null or empty name.UnknownID
- if no harvest has the given ID.IOFailure
- on any other error talking to the databasepublic List<String> getListOfDomainsOfHarvestDefinition(String harvestName)
getListOfDomainsOfHarvestDefinition
in class HarvestDefinitionDAO
harvestName
- of HarvestDefinitionpublic List<String> getListOfSeedsOfDomainOfHarvestDefinition(String harvestName, String domainName)
getListOfSeedsOfDomainOfHarvestDefinition
in class HarvestDefinitionDAO
harvestName
- of HarvestDefinitiondomainName
- of Domainpublic Set<Long> getJobIdsForSnapshotDeduplicationIndex(Long harvestId)
HarvestDefinitionDAO
getJobIdsForSnapshotDeduplicationIndex
in class HarvestDefinitionDAO
harvestId
- the id of the harvestpublic void setIndexIsReady(Long harvestId, boolean newValue)
HarvestDefinitionDAO
setIndexIsReady
in class HarvestDefinitionDAO
harvestId
- the ID of the harvest.newValue
- the new isindexready valuepublic void removeDomainConfiguration(Long harvestId, SparseDomainConfiguration key)
HarvestDefinitionDAO
removeDomainConfiguration
in class HarvestDefinitionDAO
harvestId
- Id for a specific PartialHarvestkey
- a SparseDomainConfiguration uniquely identifying the domainconfig.public void updateNextdate(long harvestId, Date nextdate)
HarvestDefinitionDAO
updateNextdate
in class HarvestDefinitionDAO
harvestId
- A given PartialHarvest id (i.e. Selective Harvest).nextdate
- A new date for the next harvest run.public void addDomainConfiguration(PartialHarvest ph, SparseDomainConfiguration dcKey)
HarvestDefinitionDAO
addDomainConfiguration
in class HarvestDefinitionDAO
ph
- a given PartialHarvestdcKey
- a reduced domainconfiguration objectpublic void resetDomainConfigurations(PartialHarvest ph, List<DomainConfiguration> dcList)
HarvestDefinitionDAO
resetDomainConfigurations
in class HarvestDefinitionDAO
ph
- a given PartialHarvestdcList
- the new list of domainconfigurationspublic void mapToHarvestChannel(long harvestDefinitionId, HarvestChannel channel)
HarvestDefinitionDAO
mapToHarvestChannel
in class HarvestDefinitionDAO
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.