Package org.archive.wayback.exception

Examples of org.archive.wayback.exception.ResourceIndexNotAvailableException


      throws ResourceIndexNotAvailableException {
   
    try {
      return adaptIterator(recordIterator(prefix,true));
    } catch (DatabaseException e) {
      throw new ResourceIndexNotAvailableException(e.getMessage());
    }
  }
View Full Code Here


  public CloseableIterator<SearchResult> getPrefixReverseIterator(String prefix)
      throws ResourceIndexNotAvailableException {
    try {
      return adaptIterator(recordIterator(prefix,false));
    } catch (DatabaseException e) {
      throw new ResourceIndexNotAvailableException(e.getMessage());
    }
  }
View Full Code Here

        // and filter:
//        filterRecords(resultsItr, forwardFilters, results, true);
        filterRecords(forward, forwardFilters, results, true);

      } catch (IOException e) {
        throw new ResourceIndexNotAvailableException(
            e.getLocalizedMessage());
      }

    } else if (searchType.equals(WaybackConstants.REQUEST_URL_QUERY)) {

      results = new CaptureSearchResults();
      // build up the FilterChain(s):
      ObjectFilterChain<SearchResult> filters =
        new ObjectFilterChain<SearchResult>();
      filters.addFilter(guardrail);
      filters.addFilter(new DuplicateRecordFilter());

      filters.addFilter(new UrlMatchFilter(keyUrl));
      if(hostMatchFilter != null) {
        filters.addFilter(hostMatchFilter);
      }
      filters.addFilter(new EndDateFilter(endDate));
      // possibly filter via exclusions:
      if (exclusion != null) {
        filters.addFilter(preExCounter);
        filters.addFilter(exclusion);
      }
      filters.addFilter(finalCounter);
      // OPTIMIZ: beginning the search at the startDate causes problems
      // with deduplicated results. We need to be smarter about rolling
      // backwards a ways if we start on a deduped record.
//      startKey = keyUrl + " " + startDate;
      startKey = keyUrl + " ";

      // add the start and end windowing filters:
      filters.addFilter(new WindowStartFilter(startResult));
      filters.addFilter(new WindowEndFilter(resultsPerPage));
      try {
        filterRecords(source.getPrefixIterator(startKey), filters, results,
            true);
      } catch (IOException e) {
        throw new ResourceIndexNotAvailableException(
            e.getLocalizedMessage());
      }
     

    } else if (searchType.equals(WaybackConstants.REQUEST_URL_PREFIX_QUERY)) {

      results = new UrlSearchResults();
      // build up the FilterChain(s):
      ObjectFilterChain<SearchResult> filters =
        new ObjectFilterChain<SearchResult>();
      filters.addFilter(guardrail);
      filters.addFilter(new DuplicateRecordFilter());

      filters.addFilter(new UrlPrefixMatchFilter(keyUrl));
      if(hostMatchFilter != null) {
        filters.addFilter(hostMatchFilter);
      }
      filters.addFilter(new DateRangeFilter(startDate, endDate));
      // possibly filter via exclusions:
      if (exclusion != null) {
        filters.addFilter(preExCounter);
        filters.addFilter(exclusion);
      }
      filters.addFilter(new CaptureToUrlResultFilter());
      filters.addFilter(finalCounter);
      startKey = keyUrl;

      // add the start and end windowing filters:
      filters.addFilter(new WindowStartFilter(startResult));
      filters.addFilter(new WindowEndFilter(resultsPerPage));
      try {
        filterRecords(source.getPrefixIterator(startKey), filters, results,
            true);
      } catch (IOException e) {
        throw new ResourceIndexNotAvailableException(
            e.getLocalizedMessage());
      }

    } else {
      throw new BadQueryException("Unknown query type(" + searchType
View Full Code Here

      LOGGER.info("Getting index XML from ("+requestUrl+")");
      document = getHttpDocument(requestUrl);
    } catch (IOException e) {
      // TODO: better error for user:
      e.printStackTrace();
      throw new ResourceIndexNotAvailableException(e.getMessage());
    } catch (SAXException e) {
      e.printStackTrace();
      throw new ResourceIndexNotAvailableException("Unexpected SAX: "
          + e.getMessage());
    }

    checkDocumentForExceptions(document);
    return documentToSearchResults(document, filter);
View Full Code Here

      String errMessage =  getNodeContent((Element) errors.item(0),
          WB_XML_ERROR_MESSAGE);
     
      // TODO: Localization Problems.. Think of something clever.
      if(errTitle == null) {
        throw new ResourceIndexNotAvailableException("Unknown error!");
      } else if(errTitle.equals("Resource Not In Archive")) {
        throw new ResourceNotInArchiveException(errMessage);
      } else if(errTitle.equals("Bad Query Exception")) {
        throw new BadQueryException(errMessage);
      } else if(errTitle.equals("Resource Index Not Available Exception")) {
        throw new ResourceIndexNotAvailableException(errMessage);
      } else if(errTitle.equals("Access Control Exception")) {
        throw new AccessControlException(errMessage);
      } else {
        throw new ResourceIndexNotAvailableException("Unknown error!");       
      }
    }
  }
View Full Code Here

    throws ResourceIndexNotAvailableException {
    try {
      return adaptIterator(getRecordIterator(prefix));
    } catch (IOException e) {
      e.printStackTrace();
      throw new ResourceIndexNotAvailableException(e.getMessage());
    }
  }
View Full Code Here

    throws ResourceIndexNotAvailableException {
    try {
      return adaptIterator(getReverseRecordIterator(prefix));
    } catch (IOException e) {
      e.printStackTrace();
      throw new ResourceIndexNotAvailableException(e.getMessage());
    }
  }
View Full Code Here

   * @see org.archive.wayback.resourceindex.SearchResultSource#getPrefixIterator(java.lang.String)
   */
  public CloseableIterator<SearchResult> getPrefixIterator(String prefix)
      throws ResourceIndexNotAvailableException {
    if(getState() != STATE_SYNCHED) {
      throw new ResourceIndexNotAvailableException("Not synchronized");
    }
    return super.getPrefixIterator(prefix);
  }
View Full Code Here

   */
  public CloseableIterator<SearchResult> getPrefixReverseIterator(String prefix)
      throws ResourceIndexNotAvailableException {

    if(getState() != STATE_SYNCHED) {
      throw new ResourceIndexNotAvailableException("Not synchronized");
    }
    return super.getPrefixReverseIterator(prefix);
  }
View Full Code Here

    try {
      checkMapFile();
    } catch (IOException e) {
      // TODO: this is too much error info if we're repeatedly failing..
      e.printStackTrace();
      throw new ResourceIndexNotAvailableException(e.getMessage());
    }

    if(groups == null || groups.length == 0) {
      throw new ResourceIndexNotAvailableException("empty map file");     
    }

 
    String searchUrl = wbRequest.get(WaybackConstants.REQUEST_URL);
    if (searchUrl == null) {
View Full Code Here

TOP

Related Classes of org.archive.wayback.exception.ResourceIndexNotAvailableException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.