Class JobDescription
- java.lang.Object
-
- org.apache.manifoldcf.crawler.jobs.JobDescription
-
- All Implemented Interfaces:
IJobDescription
public class JobDescription extends java.lang.Object implements IJobDescription
This is a paper object describing a job. Each job in the lcf framework has: - an identifier; - a description; - a repository connection; - one of a number of scheduling options: starting every n hours/days/weeks/months, on specific dates, or "continuous" (which basically establishes a priority queue based on modification frequency); - "seeds" (or starting points), which are the places that scanning begins. Also remember that since incremental deletion must occur on a job-by-job basis, the scanning data also records the job that performed the scan, so that each job can rescan previous ingested data, and delete documents that have been removed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classJobDescription.Notificationprotected static classJobDescription.PipelineStage
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected java.lang.StringconnectionNameprotected java.lang.Stringdescriptionprotected SpecificationdocumentSpecificationprotected java.lang.Longexpirationprotected java.util.HashMaphopCountFiltersprotected inthopcountModeprotected java.lang.Longidprotected java.lang.Longintervalprotected booleanisNewprotected java.lang.LongmaxIntervalprotected java.util.List<JobDescription.Notification>notificationsprotected java.util.List<JobDescription.PipelineStage>pipelineStagesprotected intpriorityprotected java.lang.Floatrateprotected booleanreadOnlyprotected java.lang.LongreseedIntervalprotected ScheduleListscheduleListprotected intstartMethodprotected inttype-
Fields inherited from interface org.apache.manifoldcf.crawler.interfaces.IJobDescription
HOPCOUNT_ACCURATE, HOPCOUNT_NEVERDELETE, HOPCOUNT_NODELETE, START_DISABLE, START_WINDOWBEGIN, START_WINDOWINSIDE, TYPE_CONTINUOUS, TYPE_SPECIFIED
-
-
Constructor Summary
Constructors Constructor Description JobDescription()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHopCountFilter(java.lang.String linkType, java.lang.Long maxHops)Add a hopcount filter to the job.SpecificationaddNotification(java.lang.String notificationConnectionName, java.lang.String notificationDescription)Add a notification.SpecificationaddPipelineStage(int prerequisiteStage, boolean isOutput, java.lang.String pipelineStageConnectionName, java.lang.String pipelineStageDescription)Add a pipeline connection.voidaddScheduleRecord(ScheduleRecord record)Add a record.voidclearHopCountFilters()Clear the set of hopcount filters for the job.voidclearNotifications()Clear notification connections.voidclearPipeline()Clear pipeline connectionsvoidclearScheduleRecords()Clear all the scheduling records.intcountNotifications()Get a count of pipeline connections.intcountPipelineStages()Get a count of pipeline stagesvoiddeleteNotification(int index)Delete a notification.voiddeletePipelineStage(int index)Delete a pipeline stage.voiddeleteScheduleRecord(int index)Delete a specified schedule record.JobDescriptionduplicate(boolean readOnly)Duplicate method, with optional "readonly" flag.java.lang.StringgetConnectionName()Get the connection name.java.lang.StringgetDescription()Get the description.java.lang.LonggetExpiration()Get the expiration time, in milliseconds.java.util.MapgetHopCountFilters()Get the set of hopcount filters the job has defined.intgetHopcountMode()Get the hopcount mode.java.lang.LonggetID()Get the id.java.lang.LonggetInterval()Get the rescheduling interval, in milliseconds.booleangetIsNew()Get isnew.java.lang.LonggetMaxInterval()Get the maximum rescheduling interval, in milliseconds.java.lang.StringgetNotificationConnectionName(int index)Get a specific notification connection name.java.lang.StringgetNotificationDescription(int index)Get a specific notification description.SpecificationgetNotificationSpecification(int index)Get a specific notification specification.java.lang.StringgetPipelineStageConnectionName(int index)Get a specific pipeline connection name.java.lang.StringgetPipelineStageDescription(int index)Get a specific pipeline stage description.booleangetPipelineStageIsOutputConnection(int index)Check if a pipeline stage is an output connection.intgetPipelineStagePrerequisite(int index)Get the prerequisite stage number for a pipeline stage.SpecificationgetPipelineStageSpecification(int index)Get a specific pipeline stage specification.intgetPriority()Get the job priority.java.lang.LonggetReseedInterval()Get the reseeding interval, in milliseconds.ScheduleRecordgetScheduleRecord(int index)Get a specified schedule record.intgetScheduleRecordCount()Get the number of schedule records.SpecificationgetSpecification()Get the document specification.intgetStartMethod()Get the job's start method.intgetType()Get the job type.SpecificationinsertNotification(int index, java.lang.String notificationConnectionName, java.lang.String notificationDescription)Insert a new notification.SpecificationinsertPipelineStage(int index, boolean isOutput, java.lang.String pipelineStageConnectionName, java.lang.String pipelineStageDescription)Insert a new pipeline stage.voidmakeReadOnly()Make the description "read only".voidsetConnectionName(java.lang.String connectionName)Set the connection name.voidsetDescription(java.lang.String description)Set the description.voidsetExpiration(java.lang.Long time)Set the expiration time, in milliseconds.voidsetHopcountMode(int mode)Set the hopcount mode.voidsetID(java.lang.Long id)Set the id.voidsetInterval(java.lang.Long interval)Set the rescheduling interval, in milliseconds.voidsetIsNew(boolean isNew)Set isnew.voidsetMaxInterval(java.lang.Long interval)Set the maximum rescheduling interval, in milliseconds, or null if forever.voidsetPriority(int priority)Set the job priority.voidsetReseedInterval(java.lang.Long interval)Set the reseeding interval, in milliseconds.voidsetStartMethod(int startMethod)Set the job's start method.voidsetType(int type)Set the job type.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
isNew
protected boolean isNew
-
id
protected java.lang.Long id
-
description
protected java.lang.String description
-
connectionName
protected java.lang.String connectionName
-
pipelineStages
protected final java.util.List<JobDescription.PipelineStage> pipelineStages
-
notifications
protected final java.util.List<JobDescription.Notification> notifications
-
type
protected int type
-
startMethod
protected int startMethod
-
priority
protected int priority
-
scheduleList
protected ScheduleList scheduleList
-
rate
protected java.lang.Float rate
-
interval
protected java.lang.Long interval
-
maxInterval
protected java.lang.Long maxInterval
-
expiration
protected java.lang.Long expiration
-
reseedInterval
protected java.lang.Long reseedInterval
-
documentSpecification
protected Specification documentSpecification
-
hopCountFilters
protected java.util.HashMap hopCountFilters
-
hopcountMode
protected int hopcountMode
-
readOnly
protected boolean readOnly
-
-
Method Detail
-
duplicate
public JobDescription duplicate(boolean readOnly)
Duplicate method, with optional "readonly" flag.
-
makeReadOnly
public void makeReadOnly()
Make the description "read only". This must be done after the object has been complete specified. Once a document is read-only, it cannot be made writable without duplication.
-
setIsNew
public void setIsNew(boolean isNew)
Set isnew.- Parameters:
isNew- is true if the object is new.
-
getIsNew
public boolean getIsNew()
Get isnew.- Specified by:
getIsNewin interfaceIJobDescription- Returns:
- true if the object is new.
-
setID
public void setID(java.lang.Long id)
Set the id.- Parameters:
id- is the id.
-
getID
public java.lang.Long getID()
Get the id.- Specified by:
getIDin interfaceIJobDescription- Returns:
- the id.
-
setDescription
public void setDescription(java.lang.String description)
Set the description.- Specified by:
setDescriptionin interfaceIJobDescription- Parameters:
description- is the description.
-
getDescription
public java.lang.String getDescription()
Get the description.- Specified by:
getDescriptionin interfaceIJobDescription- Returns:
- the description
-
setConnectionName
public void setConnectionName(java.lang.String connectionName)
Set the connection name.- Specified by:
setConnectionNamein interfaceIJobDescription- Parameters:
connectionName- is the connection name.
-
getConnectionName
public java.lang.String getConnectionName()
Get the connection name.- Specified by:
getConnectionNamein interfaceIJobDescription- Returns:
- the connection name.
-
clearPipeline
public void clearPipeline()
Clear pipeline connections- Specified by:
clearPipelinein interfaceIJobDescription
-
addPipelineStage
public Specification addPipelineStage(int prerequisiteStage, boolean isOutput, java.lang.String pipelineStageConnectionName, java.lang.String pipelineStageDescription)
Add a pipeline connection.- Specified by:
addPipelineStagein interfaceIJobDescription- Parameters:
prerequisiteStage- is the prerequisite stage number for this connection, or -1 if there is none.isOutput- is true if the pipeline stage is an output connection.pipelineStageConnectionName- is the name of the pipeline connection to add.pipelineStageDescription- is a description of the pipeline stage being added.- Returns:
- the empty output specification for this pipeline stage.
-
countPipelineStages
public int countPipelineStages()
Get a count of pipeline stages- Specified by:
countPipelineStagesin interfaceIJobDescription- Returns:
- the current number of pipeline connections.
-
insertPipelineStage
public Specification insertPipelineStage(int index, boolean isOutput, java.lang.String pipelineStageConnectionName, java.lang.String pipelineStageDescription)
Insert a new pipeline stage.- Specified by:
insertPipelineStagein interfaceIJobDescription- Parameters:
index- is the index to insert pipeline stage beforepipelineStageConnectionName- is the connection name.pipelineStageDescription- is the description.- Returns:
- the newly-created output specification.
-
getPipelineStagePrerequisite
public int getPipelineStagePrerequisite(int index)
Get the prerequisite stage number for a pipeline stage.- Specified by:
getPipelineStagePrerequisitein interfaceIJobDescription- Parameters:
index- is the index of the pipeline stage to get.- Returns:
- the preceding stage number for that stage, or -1 if there is none.
-
getPipelineStageIsOutputConnection
public boolean getPipelineStageIsOutputConnection(int index)
Check if a pipeline stage is an output connection.- Specified by:
getPipelineStageIsOutputConnectionin interfaceIJobDescription- Parameters:
index- is the index of the pipeline stage to check.- Returns:
- true if it is an output connection.
-
getPipelineStageConnectionName
public java.lang.String getPipelineStageConnectionName(int index)
Get a specific pipeline connection name.- Specified by:
getPipelineStageConnectionNamein interfaceIJobDescription- Parameters:
index- is the index of the pipeline stage whose connection name to get.- Returns:
- the name of the connection.
-
getPipelineStageDescription
public java.lang.String getPipelineStageDescription(int index)
Get a specific pipeline stage description.- Specified by:
getPipelineStageDescriptionin interfaceIJobDescription- Parameters:
index- is the index of the pipeline stage whose description to get.- Returns:
- the name of the connection.
-
getPipelineStageSpecification
public Specification getPipelineStageSpecification(int index)
Get a specific pipeline stage specification.- Specified by:
getPipelineStageSpecificationin interfaceIJobDescription- Parameters:
index- is the index of the pipeline stage whose specification is needed.- Returns:
- the specification for the connection.
-
deletePipelineStage
public void deletePipelineStage(int index)
Delete a pipeline stage.- Specified by:
deletePipelineStagein interfaceIJobDescription- Parameters:
index- is the index of the pipeline stage to delete.
-
clearNotifications
public void clearNotifications()
Clear notification connections.- Specified by:
clearNotificationsin interfaceIJobDescription
-
addNotification
public Specification addNotification(java.lang.String notificationConnectionName, java.lang.String notificationDescription)
Add a notification.- Specified by:
addNotificationin interfaceIJobDescription- Parameters:
notificationConnectionName- is the name of the notification connection to add.notificationDescription- is a description of the notification being added.- Returns:
- the empty specification for this notification.
-
countNotifications
public int countNotifications()
Get a count of pipeline connections.- Specified by:
countNotificationsin interfaceIJobDescription- Returns:
- the current number of pipeline connections.
-
getNotificationConnectionName
public java.lang.String getNotificationConnectionName(int index)
Get a specific notification connection name.- Specified by:
getNotificationConnectionNamein interfaceIJobDescription- Parameters:
index- is the index of the notification whose connection name to get.- Returns:
- the name of the connection.
-
getNotificationDescription
public java.lang.String getNotificationDescription(int index)
Get a specific notification description.- Specified by:
getNotificationDescriptionin interfaceIJobDescription- Parameters:
index- is the index of the notification whose description to get.- Returns:
- the name of the connection.
-
getNotificationSpecification
public Specification getNotificationSpecification(int index)
Get a specific notification specification.- Specified by:
getNotificationSpecificationin interfaceIJobDescription- Parameters:
index- is the index of the notification whose specification is needed.- Returns:
- the specification for the connection.
-
deleteNotification
public void deleteNotification(int index)
Delete a notification.- Specified by:
deleteNotificationin interfaceIJobDescription- Parameters:
index- is the index of the notification to delete.
-
insertNotification
public Specification insertNotification(int index, java.lang.String notificationConnectionName, java.lang.String notificationDescription)
Insert a new notification.- Specified by:
insertNotificationin interfaceIJobDescription- Parameters:
index- is the index to insert pipeline stage beforenotificationConnectionName- is the connection name.notificationDescription- is the description.- Returns:
- the newly-created output specification.
-
setType
public void setType(int type)
Set the job type.- Specified by:
setTypein interfaceIJobDescription- Parameters:
type- is the type (as an integer).
-
getType
public int getType()
Get the job type.- Specified by:
getTypein interfaceIJobDescription- Returns:
- the type (as an integer).
-
setStartMethod
public void setStartMethod(int startMethod)
Set the job's start method.- Specified by:
setStartMethodin interfaceIJobDescription- Parameters:
startMethod- is the start description.
-
getStartMethod
public int getStartMethod()
Get the job's start method.- Specified by:
getStartMethodin interfaceIJobDescription- Returns:
- the start method.
-
clearScheduleRecords
public void clearScheduleRecords()
Clear all the scheduling records.- Specified by:
clearScheduleRecordsin interfaceIJobDescription
-
addScheduleRecord
public void addScheduleRecord(ScheduleRecord record)
Add a record.- Specified by:
addScheduleRecordin interfaceIJobDescription- Parameters:
record- is the record to add.
-
getScheduleRecordCount
public int getScheduleRecordCount()
Get the number of schedule records.- Specified by:
getScheduleRecordCountin interfaceIJobDescription- Returns:
- the count.
-
getScheduleRecord
public ScheduleRecord getScheduleRecord(int index)
Get a specified schedule record.- Specified by:
getScheduleRecordin interfaceIJobDescription- Parameters:
index- is the record number.- Returns:
- the record.
-
deleteScheduleRecord
public void deleteScheduleRecord(int index)
Delete a specified schedule record.- Specified by:
deleteScheduleRecordin interfaceIJobDescription- Parameters:
index- is the record number.
-
setInterval
public void setInterval(java.lang.Long interval)
Set the rescheduling interval, in milliseconds.- Specified by:
setIntervalin interfaceIJobDescription- Parameters:
interval- is the default interval, or null for infinite.
-
getInterval
public java.lang.Long getInterval()
Get the rescheduling interval, in milliseconds.- Specified by:
getIntervalin interfaceIJobDescription- Returns:
- the default interval, or null for infinite.
-
setMaxInterval
public void setMaxInterval(java.lang.Long interval)
Set the maximum rescheduling interval, in milliseconds, or null if forever.- Specified by:
setMaxIntervalin interfaceIJobDescription- Parameters:
interval- is the maximum interval.
-
getMaxInterval
public java.lang.Long getMaxInterval()
Get the maximum rescheduling interval, in milliseconds.- Specified by:
getMaxIntervalin interfaceIJobDescription- Returns:
- the max interval, or null if forever.
-
setExpiration
public void setExpiration(java.lang.Long time)
Set the expiration time, in milliseconds.- Specified by:
setExpirationin interfaceIJobDescription- Parameters:
time- is the maximum expiration time of a document, in milliseconds, or null if none.
-
getExpiration
public java.lang.Long getExpiration()
Get the expiration time, in milliseconds.- Specified by:
getExpirationin interfaceIJobDescription- Returns:
- the maximum expiration time of a document, or null if none.
-
setReseedInterval
public void setReseedInterval(java.lang.Long interval)
Set the reseeding interval, in milliseconds.- Specified by:
setReseedIntervalin interfaceIJobDescription- Parameters:
interval- is the interval, or null for infinite.
-
getReseedInterval
public java.lang.Long getReseedInterval()
Get the reseeding interval, in milliseconds.- Specified by:
getReseedIntervalin interfaceIJobDescription- Returns:
- the interval, or null if infinite.
-
getSpecification
public Specification getSpecification()
Get the document specification.- Specified by:
getSpecificationin interfaceIJobDescription- Returns:
- the document specification object.
-
setPriority
public void setPriority(int priority)
Set the job priority. This is a simple integer between 1 and 10, where 1 is the highest priority.- Specified by:
setPriorityin interfaceIJobDescription- Parameters:
priority- is the priority.
-
getPriority
public int getPriority()
Get the job priority.- Specified by:
getPriorityin interfaceIJobDescription- Returns:
- the priority (a number between 1 and 10).
-
getHopCountFilters
public java.util.Map getHopCountFilters()
Get the set of hopcount filters the job has defined.- Specified by:
getHopCountFiltersin interfaceIJobDescription- Returns:
- the set as a map, keyed by Strings and containing Longs.
-
clearHopCountFilters
public void clearHopCountFilters()
Clear the set of hopcount filters for the job.- Specified by:
clearHopCountFiltersin interfaceIJobDescription
-
addHopCountFilter
public void addHopCountFilter(java.lang.String linkType, java.lang.Long maxHops)Add a hopcount filter to the job.- Specified by:
addHopCountFilterin interfaceIJobDescription- Parameters:
linkType- is the type of link the filter applies to.maxHops- is the maximum hop count. Use null to remove a filter.
-
getHopcountMode
public int getHopcountMode()
Get the hopcount mode.- Specified by:
getHopcountModein interfaceIJobDescription
-
setHopcountMode
public void setHopcountMode(int mode)
Set the hopcount mode.- Specified by:
setHopcountModein interfaceIJobDescription
-
-