public class Engine extends Object
Modifier and Type | Field and Description |
---|---|
protected HashMap<String,CrawlJob> |
jobConfigs
map of job short names -> CrawlJob instances
|
protected File |
jobsDir
directory where job directories are expected
|
static String |
LOGS_DIR_NAME |
protected String |
profileCxmlPath |
static String |
REPORTS_DIR_NAME |
Modifier and Type | Method and Description |
---|---|
boolean |
addJobDirectory(File dir)
Adds a job directory to the Engine known jobConfigs if not extant.
|
void |
copy(CrawlJob orig,
File destDir,
boolean asProfile)
Copy a job to a new location, possibly making a job
a profile or a profile a runnable job.
|
void |
copy(CrawlJob cj,
String copyTo,
boolean asProfile)
Copy a job to a new location, possibly making a job
a profile or a profile a runnable job.
|
boolean |
createNewJobWithDefaults(File newJobDir)
create a new job dir and copy profile CXML into as non-profile CXML
|
void |
deleteJob(CrawlJob job) |
void |
findJobConfigs()
Find all job configurations in the usual place -- subdirectories
of the jobs directory with files ending '.cxml', and from jobPathFiles
(previously added by user) found in the jobs directory
|
String |
getHeritrixVersion() |
CrawlJob |
getJob(String shortName) |
Map<String,CrawlJob> |
getJobConfigs() |
protected File |
getJobDirectoryFrom(File jobPathFile)
Return the job directory File read from the supplied ".jobpath" file,
or null on any error.
|
File |
getJobsDir() |
protected InputStream |
getProfileCxmlResource() |
String |
heapReport() |
Map<String,Object> |
heapReportData() |
void |
requestLaunch(String shortName) |
void |
shutdown() |
boolean |
waitForNoRunningJobs(long timeout)
Wait for all jobs to be in non-running state, or until timeout
(given in ms) elapses.
|
void |
writeJobPathFile(CrawlJob job)
Writes a .jobpath file for the new CrawlJob, whose directory is
outside the main Engine jobs directory.
|
public static final String LOGS_DIR_NAME
public static final String REPORTS_DIR_NAME
protected File jobsDir
protected HashMap<String,CrawlJob> jobConfigs
protected String profileCxmlPath
public Engine(File jobsDir)
public void findJobConfigs()
protected File getJobDirectoryFrom(File jobPathFile)
public boolean addJobDirectory(File dir)
dir
- directory to be addedpublic void copy(CrawlJob orig, File destDir, boolean asProfile) throws IOException
orig
- CrawlJob representing sourcedestDir
- File location destinationasProfile
- true if destination should become a profileIOException
public void copy(CrawlJob cj, String copyTo, boolean asProfile) throws IOException
cj
- CrawlJob representing sourcecopyTo
- String location destination; interpreted relative to jobsDirasProfile
- true if destination should become a profileIOException
public String getHeritrixVersion()
public void deleteJob(CrawlJob job) throws IOException
IOException
public void requestLaunch(String shortName)
public File getJobsDir()
public String heapReport()
public void shutdown()
public boolean waitForNoRunningJobs(long timeout)
timeout
- protected InputStream getProfileCxmlResource()
public boolean createNewJobWithDefaults(File newJobDir)
newJobDir
- new job directoryIOException
public void writeJobPathFile(CrawlJob job) throws IOException
job
- CrawlJob whose main directory the .jobpath should point toIOException
- for any IO errorCopyright © 2003-2014 Internet Archive. All Rights Reserved.