public abstract class HarvestDefinition extends ExtendableEntity implements Named
The specializing classes FullHarvest and PartielHarvest contains the specific properties and operations of snapshot harvestdefinitions and all other kinds of harvestdefinitions, respectively.
Methods exist to generate jobs from this harvest definition.
Modifier and Type | Field and Description |
---|---|
protected String |
audience
The intended audience for the harvest.
|
protected Long |
channelId
The id of the associated harvest channel, or null if the default one is to be used.
|
protected String |
comments |
protected long |
edition
Edition is used by the DAO to keep track of changes.
|
protected String |
harvestDefName |
protected boolean |
isActive
Determines if the harvest definition is active and ready for scheduling.
|
protected int |
numEvents
The number of times this event has already run.
|
protected Long |
oid |
protected Date |
submissionDate
The time this harvest definition was first written.
|
extendedFieldValues
Modifier | Constructor and Description |
---|---|
protected |
HarvestDefinition(javax.inject.Provider<ExtendedFieldDAO> extendedFieldDAO) |
Modifier and Type | Method and Description |
---|---|
static FullHarvest |
createFullHarvest(String harvestDefName,
String comments,
Long prevHarvestOid,
long maxCountObjects,
long maxBytes,
long maxJobRunningTime)
Create snapshot harvestdefinition.
|
static PartialHarvest |
createPartialHarvest(List<DomainConfiguration> domainConfigurations,
Schedule schedule,
String harvestDefName,
String comments,
String audience)
Create new instance of a PartialHavest configured according to the properties of the supplied
DomainConfiguration.
|
boolean |
equals(Object o)
Tests whether some other object is "equal to" this HarvestDefinition.
|
boolean |
getActive()
Returns the activation status.
|
String |
getAudience() |
Long |
getChannelId() |
String |
getComments()
Returns the comments for this harvest definition.
|
abstract Iterator<DomainConfiguration> |
getDomainConfigurations()
Returns a iterator of domain configurations for this harvest definition.
|
long |
getEdition()
Get the edition number.
|
protected int |
getExtendedFieldType()
All derived classes allow ExtendedFields from Type ExtendedFieldTypes.HARVESTDEFINITION
|
abstract long |
getMaxBytes()
Returns how many bytes to harvest per domain, or -1 for no limit.
|
abstract long |
getMaxCountObjects()
Returns how many objects to harvest per domain, or 0 for no limit.
|
String |
getName()
Returns the name of the harvest definition.
|
int |
getNumEvents()
Get the number of times this harvest definition has been run so far.
|
Long |
getOid()
Return the object ID of this harvest definition.
|
Date |
getSubmissionDate()
Returns the submission date.
|
int |
hashCode()
Returns a hashcode of this object generated on fields oid, harvestDefName, and comments.
|
abstract boolean |
isSnapShot()
Used to check if a harvestdefinition is a snapshot harvestdefinition.
|
abstract boolean |
runNow(Date now)
Check if this harvest definition should be run, given the time now.
|
void |
setActive(boolean active)
Set's activation status.
|
void |
setAudience(String audience)
Set the audience.
|
protected void |
setChannelId(Long channelId) |
void |
setComments(String comments)
Set the comments for this harvest definition.
|
void |
setEdition(long theEdition)
Set the edition number.
|
void |
setNumEvents(int numEvents)
Set the number of times this harvest definition has been run so far.
|
void |
setOid(Long oid)
Set the object ID of this harvest definition.
|
void |
setSubmissionDate(Date submissionDate)
Set the submission date.
|
String |
toString()
Return a human-readable string representation of this object.
|
addExtendedFieldValue, addExtendedFieldValues, getExtendedFieldValue, getExtendedFieldValues, setExtendedFieldValues, updateExtendedFieldValue
protected String harvestDefName
protected Date submissionDate
protected long edition
protected boolean isActive
protected int numEvents
protected HarvestDefinition(javax.inject.Provider<ExtendedFieldDAO> extendedFieldDAO)
public static PartialHarvest createPartialHarvest(List<DomainConfiguration> domainConfigurations, Schedule schedule, String harvestDefName, String comments, String audience)
domainConfigurations
- a list of domain configurationsschedule
- the harvest definition scheduleharvestDefName
- the name of the harvest definitioncomments
- commentspublic static FullHarvest createFullHarvest(String harvestDefName, String comments, Long prevHarvestOid, long maxCountObjects, long maxBytes, long maxJobRunningTime)
When a previous harvest definition is supplied, only domains not completely harvested by the previous harvestdefinition are included in this harvestdefinition. indexready set to false.
harvestDefName
- the name of the harvest definitioncomments
- description of the harvestdefinitionprevHarvestOid
- an id of a previous harvest to use as basis for this definition, ignored when null.maxCountObjects
- the maximum number of objects harvested from any domainmaxBytes
- the maximum number of bytes harvested from any domainmaxJobRunningTime
- The maximum running time for each jobpublic void setOid(Long oid)
oid
- The oidArgumentNotValid
- if the oid is nullpublic Long getOid()
public void setSubmissionDate(Date submissionDate)
submissionDate
- the time when the harvestdefinition was createdpublic Date getSubmissionDate()
public String getComments()
getComments
in interface Named
public void setComments(String comments)
comments
- A user-entered string.public long getEdition()
public void setEdition(long theEdition)
theEdition
- the new edition of the harvestdefinitionpublic int getNumEvents()
public void setNumEvents(int numEvents)
numEvents
- The number.ArgumentNotValid
- if numEvents is negativepublic void setActive(boolean active)
active
- new activation statuspublic boolean getActive()
public abstract Iterator<DomainConfiguration> getDomainConfigurations()
public boolean equals(Object o)
public int hashCode()
public abstract boolean runNow(Date now)
now
- The current timepublic abstract boolean isSnapShot()
public abstract long getMaxCountObjects()
public abstract long getMaxBytes()
public String getAudience()
public void setAudience(String audience)
audience
- the audience.public Long getChannelId()
protected void setChannelId(Long channelId)
protected int getExtendedFieldType()
getExtendedFieldType
in class ExtendableEntity
Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.