Examples of MessageSearchException


Examples of com.stimulus.archiva.exception.MessageSearchException

      try {
         hits = searchers.search(query,queryFilter,sort);
        logger.info("search executed successfully {query='"+getSearchQuery()+"', nohits='"+hits.length()+"'}");
     } catch (IOException io)
     {
      throw new MessageSearchException("failed to execute search query {searchquery='"+getSearchQuery()+"}",io,logger);
     }
   
     return hits;
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

       }*/
              
       try {
          searchers.close();
       } catch (IOException io) {
        throw new MessageSearchException("failed to close search indexes (opened for read)",io,logger);
       }
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

   
    }

    public void searchMessage(Search search) throws MessageSearchException {
      if (search==null)
             throw new MessageSearchException("assertion failure: null search",logger);
        if (((MailArchivaPrincipal)search.getPrincipal()).getRole()==null || ((MailArchivaPrincipal)search.getPrincipal()).getName()==null)
            throw new MessageSearchException("assertion failure: null userRole or userName",logger);
        String queryStr = search.getSearchQuery();
        logger.debug("search {searchquery='"+queryStr+"'}");
        search.searchMessage();
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

        searchQuery += and(searchQuery,dateQuery);
        try {
          query = queryParser.parse(searchQuery);
          logger.debug("successfully parsed search query {query='"+searchQuery+"'}");
        } catch (Exception e) {
          throw new MessageSearchException("failed to parse search query {query='"+searchQuery+"'}",e,logger);
        }
        return query;
   
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

          queryFilter = new QueryWrapperFilter(query);
          logger.debug("successfully parsed filter query {query='"+filterstr+"'}");
          logger.debug("queryfilter"+query.toString());
      } catch (Exception pe)
      {
        throw new MessageSearchException("failed to parse search query {searchquery='"+getSearchQuery()+"'}",pe,logger);
      }
      return queryFilter;
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

      Searcher searcher;
       try {
           searcher = new ParallelMultiSearcher(allsearchers);
      } catch (IOException io) {
          throw new MessageSearchException("failed to open/create one or more index searchers",logger);
      }
      return searcher;
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

      try {
         hits = searchers.search(query,queryFilter,sort);
        logger.info("search executed successfully {query='"+getSearchQuery()+"', nohits='"+hits.length()+"'}");
     } catch (IOException io)
     {
      throw new MessageSearchException("failed to execute search query {searchquery='"+getSearchQuery()+"}",io,logger);
     }
   
     return hits;
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

        worker.start();
    }
   
    public long getTotalMessageCount(Volume volume) throws MessageSearchException {
      if (volume == null)
              throw new MessageSearchException("assertion failure: null volume",logger);
      logger.debug("get total no emails {indexpath='"+volume.getIndexPath()+"'}");
        File indexDir = new File(volume.getIndexPath());
        if (!indexDir.exists())
            return 0;
        IndexReader indexReader = null;
        try {
          indexReader = IndexReader.open(indexDir);
        } catch (IOException e ) {
          throw new MessageSearchException("failed to open index to calculate total email count",e,logger);
        }
        return indexReader.numDocs();
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

    }
//   deliberately non recursive (so we avoid situations where the whole h/d is deleted)
    public void deleteIndex(Volume volume) throws MessageSearchException {
     
        if (volume == null)
              throw new MessageSearchException("assertion failure: null volume",logger);

        logger.debug("delete index {indexpath='"+volume.getIndexPath()+"'}");
        // we need to stop indexing for a brief moment
        shutdownIndexer();
        VolumeIndex volumeIndex = getVolumeIndex(volume);
        volumeIndex.closeIndex();
        File indexDir = new File(volume.getIndexPath());
        if (!indexDir.exists()) return;
        if (indexDir.isDirectory()) {
              String[] children = indexDir.list();
              for (int i=0; i<children.length; i++) {
                  String filepath = volume.getIndexPath()+File.separatorChar+children[i];
                  logger.debug("deleting file {path='" + filepath +"'}");
                  File file = new File(filepath);
                  boolean success = file.delete();
                  if (!success) {
                    try {
                      File newFile = File.createTempFile("temp","idx");
                      file.renameTo(newFile);
                    } catch (Exception e) {
                      throw new MessageSearchException("failed to delete file in existing index {filepath='"+filepath+"'}",logger);
                    }
                  } else
                         logger.debug("deleted file successfully {filepath='" + filepath +"'}");
              }
        }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

    }
    // Enterprise version
   
    public void deleteMessage(EmailID emailID) throws MessageSearchException {
      if (emailID == null)
              throw new MessageSearchException("assertion failure: null emailID",logger);
      logger.debug("delete message {'"+emailID+"'}");
      Volume volume = emailID.getVolume();
        File indexDir = new File(volume.getIndexPath());
      if (!indexDir.exists())
        throw new MessageSearchException("could not delete email from index. volume does not exist. {'"+emailID+"}",logger);
        IndexReader indexReader = null;
        try {
          indexReader = IndexReader.open(indexDir);
        } catch (IOException e ) {
          throw new MessageSearchException("failed to open index to calculate total email count",e,logger);
        }
        try {
          indexReader.deleteDocuments(new Term("uid",emailID.getUniqueID()));
          indexReader.close();
        } catch (Exception e) {
          throw new MessageSearchException("failed to delete email from index.",e,logger);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.