Search in sources :

Example 1 with ContentNotFoundException

use of org.codelibs.fess.exception.ContentNotFoundException in project fess by codelibs.

the class FessCrawlerThread method processResponse.

@Override
protected void processResponse(final UrlQueue<?> urlQueue, final ResponseData responseData) {
    super.processResponse(urlQueue, responseData);
    FessConfig fessConfig = ComponentUtil.getFessConfig();
    if (fessConfig.isCrawlerFailureUrlStatusCodes(responseData.getHttpStatusCode())) {
        String sessionId = crawlerContext.getSessionId();
        final CrawlingConfig crawlingConfig = ComponentUtil.getCrawlingConfigHelper().get(sessionId);
        final String url = urlQueue.getUrl();
        final FailureUrlService failureUrlService = ComponentUtil.getComponent(FailureUrlService.class);
        failureUrlService.store(crawlingConfig, ContentNotFoundException.class.getCanonicalName(), url, new ContentNotFoundException(url));
    }
}
Also used : CrawlingConfig(org.codelibs.fess.es.config.exentity.CrawlingConfig) ContentNotFoundException(org.codelibs.fess.exception.ContentNotFoundException) FailureUrlService(org.codelibs.fess.app.service.FailureUrlService) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig)

Aggregations

FailureUrlService (org.codelibs.fess.app.service.FailureUrlService)1 CrawlingConfig (org.codelibs.fess.es.config.exentity.CrawlingConfig)1 ContentNotFoundException (org.codelibs.fess.exception.ContentNotFoundException)1 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)1