Package org.archive.wayback.exception

Examples of org.archive.wayback.exception.ResourceIndexNotAvailableException


      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

    Comparator<CaptureSearchResult> comparator = new SearchResultComparator();
    CompositeSortedIterator<CaptureSearchResult> itr = new CompositeSortedIterator<CaptureSearchResult>(comparator);
   
    int added = 0;
    ResourceIndexNotAvailableException lastExc = null;
   
    for (int i = 0; i < sources.size(); i++) {
      SearchResultSource source = sources.get(i);
     
      try {
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.getRequestUrl();
    if (searchUrl == null) {
View Full Code Here

        numBlocks++;
        String parts[] = blockDescriptor.split("\t");
        if(parts.length != 4) {
          LOGGER.severe("Bad Block descriptor Line(" +
              blockDescriptor + " in " + chunkIndex.getPath());
          throw new ResourceIndexNotAvailableException("Bad line(" +
              blockDescriptor + ")");
        }
        // only compare the correct length:
        String prefCmp = prefix;
        String blockCmp = parts[0];
View Full Code Here

   */
  public SearchResults query(WaybackRequest wbRequest) throws ResourceIndexNotAvailableException, ResourceNotInArchiveException, BadQueryException, AccessControlException {
    while(true) {
      RangeMember best = findBestMember();
      if(best == null) {
        throw new ResourceIndexNotAvailableException("Unable to find active range for request.");
      }
      best.noteConnectionStart();
      SearchResults results;
      try {

View Full Code Here

  public CloseableIterator<CaptureSearchResult> getPrefixIterator(
      String prefix) throws ResourceIndexNotAvailableException {
    try {
      return adaptIterator(getStringPrefixIterator(prefix));
    } catch (IOException e) {
      throw new ResourceIndexNotAvailableException(e.getMessage());
    }
  }
View Full Code Here

        String blockDescriptor = currLine;
        String parts[] = blockDescriptor.split("\t");
        if((parts.length < 3)) {
          LOGGER.severe("Bad line(" + blockDescriptor +") in (" +
              chunkMapPath + ")");
          throw new ResourceIndexNotAvailableException("Bad line(" +
              blockDescriptor + ")");
        }
        // only compare the correct length:
        String prefCmp = urlkey;
        String blockCmp = parts[0];
        if(first) {
          // always add first:
          first = false;
        } else if(!blockCmp.startsWith(prefCmp)) {
          // all done;
          break;
        }
        // add this and keep lookin...
        BlockLocation bl = chunkMap.get(parts[1]);
        if(bl == null) {
          LOGGER.severe("No locations for block(" + parts[1] +")");
          throw new ResourceIndexNotAvailableException(
              "No locations for block(" + parts[1] + ")");
        }
        long offset = Long.parseLong(parts[2]);
        ZiplinedBlock block;
        if(parts.length == 3) {
View Full Code Here

   * @see org.archive.wayback.resourceindex.SearchResultSource#getPrefixReverseIterator(java.lang.String)
   */
        @Override
  public CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(
      String prefix) throws ResourceIndexNotAvailableException {
    throw new ResourceIndexNotAvailableException("unsupported op");
  }
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

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.