Package org.lockss.laaws.crawler.impl
Class PluggableCrawlManager
java.lang.Object
org.lockss.app.BaseLockssManager
org.lockss.app.BaseLockssDaemonManager
org.lockss.laaws.crawler.impl.PluggableCrawlManager
- All Implemented Interfaces:
org.lockss.app.ConfigurableManager,org.lockss.app.LockssManager
public class PluggableCrawlManager
extends org.lockss.app.BaseLockssDaemonManager
implements org.lockss.app.ConfigurableManager
The type Pluggable crawl manager.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lockss.app.BaseLockssManager
org.lockss.app.BaseLockssManager.MapMessageListener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe constant CRAWLER_ID.static final StringThe constant CRAWLER_NAME.static final StringThe constant CRAWLING_ENABLED.static final StringThe constant CRAWL_STARTER_ENABLED.static final StringThe constant CRAWLER_IDS.static final Stringstatic final StringThe constant DB_FILENAME.static final StringThe constant DEFAULT_CRAWL_DB_PATH.static booleanThe default list of known crawlers.static final StringThe constant ENABLED.static final StringThe constant PARAM_CRAWL_DB_PATH.static final Stringstatic final StringThe constant PREFIX.Fields inherited from class org.lockss.app.BaseLockssManager
isInited, isStarted, jmsConsumer, jmsProducer, shuttingDown, startedSem, theApp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCrawlJob(org.lockss.util.rest.crawler.CrawlJob crawlJob) Insert crawl Job into persistent store.voidDelete all crawls.longgetCrawler(String crawlerId) Gets crawler.getCrawlerConfig(String crawlerId) Gets crawler config.Gets crawler ids.org.lockss.util.rest.crawler.CrawlJobgetCrawlJob(String jobId) Gets crawl status.org.dizitart.no2.objects.Cursor<org.lockss.util.rest.crawler.CrawlJob>getCrawlJobsWithAuId(String auId) Gets crawl jobs with au id.longintlonglongvoidhandleCrawlComplete(org.lockss.crawler.CrawlerStatus status) handle the complete crawl.voidhandleCrawlComplete(org.lockss.crawler.CrawlEvent event) handle the complete crawl.booleanis crawling enabledbooleanisCrawlerEnabled(String crawlerId) Is a specific crawler enabledbooleanis the crawl starter enabledbooleanisEligibleForCrawl(String auId) Is eligible Au elgible for crawl boolean.voidvoidrestart unfinished crawls.voidsetConfig(org.lockss.config.Configuration newConfig, org.lockss.config.Configuration prevConfig, org.lockss.config.Configuration.Differences changedKeys) voidvoidvoidupdateCrawlJob(org.lockss.util.rest.crawler.CrawlJob crawlJob) Update a crawl Jobs status.Methods inherited from class org.lockss.app.BaseLockssDaemonManager
getDaemon, initService, initService, isDaemonInitedMethods inherited from class org.lockss.app.BaseLockssManager
getAlertManager, getApp, getClassName, getConfigManager, getDefaultTempRootDirectory, getJMSManager, getManagerByType, isAppInited, isInited, isRepoReady, isShuttingDown, isStarted, receiveMessage, resetConfig, serviceStarted, setUpJmsReceive, setUpJmsReceive, setUpJmsSend, stopJms, waitForRepo, waitForRepo, waitStarted, waitStartedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lockss.app.ConfigurableManager
auConfigChanged, auConfigRemoved
-
Field Details
-
PREFIX
The constant PREFIX.- See Also:
-
CRAWLER_PREFIX
- See Also:
-
PARAM_CRAWL_DB_PATH
The constant PARAM_CRAWL_DB_PATH.- See Also:
-
DEFAULT_CRAWL_DB_PATH
The constant DEFAULT_CRAWL_DB_PATH.- See Also:
-
PARAM_REQUEUE_ON_RESTART
- See Also:
-
DEFAULT_REQUEUE_ON_RESTART
public static boolean DEFAULT_REQUEUE_ON_RESTART -
DB_FILENAME
The constant DB_FILENAME.- See Also:
-
CRAWLER_IDS
The constant CRAWLER_IDS.- See Also:
-
defaultCrawlerIds
The default list of known crawlers. -
ATTR_CRAWLER_ID
The constant CRAWLER_ID.- See Also:
-
ATTR_CRAWLER_NAME
The constant CRAWLER_NAME.- See Also:
-
ATTR_CRAWLING_ENABLED
The constant CRAWLING_ENABLED.- See Also:
-
ATTR_STARTER_ENABLED
The constant CRAWL_STARTER_ENABLED.- See Also:
-
ENABLED
The constant ENABLED.- See Also:
-
-
Constructor Details
-
PluggableCrawlManager
public PluggableCrawlManager()
-
-
Method Details
-
startService
public void startService()- Specified by:
startServicein interfaceorg.lockss.app.LockssManager- Overrides:
startServicein classorg.lockss.app.BaseLockssManager
-
stopService
public void stopService()- Specified by:
stopServicein interfaceorg.lockss.app.LockssManager- Overrides:
stopServicein classorg.lockss.app.BaseLockssManager
-
setConfig
public void setConfig(org.lockss.config.Configuration newConfig, org.lockss.config.Configuration prevConfig, org.lockss.config.Configuration.Differences changedKeys) - Specified by:
setConfigin interfaceorg.lockss.app.ConfigurableManager
-
getMaxRetries
public int getMaxRetries() -
getRetryDelay
public long getRetryDelay() -
getConnectTimeout
public long getConnectTimeout() -
getReadTimeout
public long getReadTimeout() -
getFetchDelay
public long getFetchDelay() -
getCrawlerIds
Gets crawler ids.- Returns:
- the crawler ids
-
isEligibleForCrawl
Is eligible Au elgible for crawl boolean.- Parameters:
auId- the au id- Returns:
- the boolean
-
isCrawlerEnabled
public boolean isCrawlerEnabled()is crawling enabled- Returns:
- true iff crawler (global is enabled)
-
isCrawlStarterEnabled
public boolean isCrawlStarterEnabled()is the crawl starter enabled- Returns:
- boolean are crawls allowed to start
-
getCrawlJob
Gets crawl status.- Parameters:
jobId- the id- Returns:
- the crawl status
-
getCrawlJobsWithAuId
public org.dizitart.no2.objects.Cursor<org.lockss.util.rest.crawler.CrawlJob> getCrawlJobsWithAuId(String auId) Gets crawl jobs with au id.- Parameters:
auId- the au id- Returns:
- the crawl jobs with au id
-
addCrawlJob
public void addCrawlJob(org.lockss.util.rest.crawler.CrawlJob crawlJob) Insert crawl Job into persistent store. throws if crawl job already exists.- Parameters:
crawlJob- the crawl job.
-
updateCrawlJob
public void updateCrawlJob(org.lockss.util.rest.crawler.CrawlJob crawlJob) Update a crawl Jobs status. throws if crawl job does not exist.- Parameters:
crawlJob- the crawl job.
-
restartCrawls
public void restartCrawls()restart unfinished crawls. -
markInterruptedCrawls
public void markInterruptedCrawls() -
deleteAllCrawls
public void deleteAllCrawls()Delete all crawls. -
getCrawlerConfig
Gets crawler config.- Parameters:
crawlerId- the crawler id- Returns:
- the crawler config
-
getCrawler
Gets crawler.- Parameters:
crawlerId- the crawler id- Returns:
- the crawler
-
isCrawlerEnabled
Is a specific crawler enabled- Parameters:
crawlerId- the id of the crawler- Returns:
- true if the crawler is found in the configuration map and is marked enabled.
-
handleCrawlComplete
public void handleCrawlComplete(org.lockss.crawler.CrawlEvent event) handle the complete crawl.- Parameters:
event- the crawl complete event.
-
handleCrawlComplete
public void handleCrawlComplete(org.lockss.crawler.CrawlerStatus status) handle the complete crawl.- Parameters:
status- the status of the completed crawl.
-