Examples of MessageSearchException


Examples of com.stimulus.archiva.exception.MessageSearchException

        }
    }

    public void indexMessage(EmailID emailID) throws MessageSearchException {
        if (emailID==null)
              throw new MessageSearchException("assertion failure: null emailId",logger);
        indexQueue.addFirst(emailID);
        logger.debug("add message to index queue {queueSize='"+indexQueue.size()+"'," + emailID + "}");
    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

    }

    public void createIndexDir(Volume volume) throws MessageSearchException {

        if (volume==null)
              throw new MessageSearchException("assertion failure: null volume",logger);

        if (volume.getIndexPath().startsWith("rmi://"))
            return;
           
        File indexDir = new File(volume.getIndexPath());
          if (!indexDir.exists()) {
         logger.info("index director2y does not exist. will proceed with creation {location='" + volume.getIndexPath() + "'}");
         boolean success = indexDir.mkdir();
         if (!success)
             throw new MessageSearchException("failed to create index directory {location='" + volume.getIndexPath() + "'}",logger);
         logger.info("index directory successfully created {location='" + volume.getIndexPath() + "'}");
         }

    }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

      }
      
        protected void openIndexR(boolean retry) throws MessageSearchException {
           
            if (volume == null)
                throw new MessageSearchException("assertion failure: null volume",logger);
            logger.debug("opening index for write {"+volume+"}");
            createIndexDir(volume);
        logger.debug("opening search index for write {indexpath='"+volume.getIndexPath()+"'}");
        try {
          synchronized(indexLock) {
            writer = new IndexWriter(volume.getIndexPath(), analyzer);
            writer.setMergeFactor(2);
            writer.setMaxMergeDocs(7000000);
          }
          //writer.setMinMergeDocs(5);
          } catch (IOException io)
        {
            if (!retry) {
                // most obvious reason for error is that there is a lock on the index, due hard shutdown
                  // resolution delete the lock, and try again
                  logger.warn("failed to open search index for write. possible write lock due to hard system shutdown.",io);
                  logger.info("attempting recovery. deleting index lock file and retrying..");
                  File lockFile = new File(volume.getIndexPath()+File.separatorChar + "write.lock");
                  lockFile.delete();
                  try {
                    openIndexR(true);
                  } catch (MessageSearchException mse) {
                    throw mse;
                  }
            } else
              throw new MessageSearchException("failed to open/create index writer {location='"+volume.getIndexPath()+"'}",io,logger);
        }
        }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

          }
         
          Email message = ms.retrieveMessage(emailId);
         
            if (message == null)
                throw new MessageSearchException("assertion failure: null message",logger);
   
            logger.debug("indexing message {"+message+"}");
           
            Document doc = new Document();
            TempFiles tempFiles = Config.getTempFiles();
       
            try {
           writeMessageToDocument(message,doc,tempFiles)
           String language = doc.get("lang");
           if (language==null)
             language = Config.getConfig().getIndexLanguage();
          synchronized(indexLock) {
            writer.addDocument(doc,AnalyzerFactory.getAnalyzer(language,AnalyzerFactory.Operation.INDEX));
          }
            logger.debug("message indexed successfully {"+message+",language='"+language+"'}");
        } catch (MessagingException me)
        {
           throw new MessageSearchException("failed to decode message during indexing",me,logger);
        } catch (IOException me) {
            throw new MessageSearchException("failed to index message {"+message+"}",me,logger);
        } catch (ExtractionException ee)
        {
           throw new MessageSearchException("failed to decode attachments in message {"+message+"}",ee,logger);
        } catch (Exception e) {
            throw new MessageSearchException("failed to index message",e,logger);
        }
        logger.debug("indexing message end {"+message+"}");
     
 
        }
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

       
        if (doc==null)
            doc = searcher.doc(scoreDoc.doc);
        return doc;
      } catch (Exception e) {
        throw new MessageSearchException("failed to retrieve document from hits:"+e.getMessage(),e,logger,ChainedException.Level.DEBUG);
       
      }
    }
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

            query = queryParser.parse(getSearchQuery());
            logger.debug("successfully parsed search query {query='"+getSearchQuery()+"'}");
          } catch (Exception e) {
            searchQuery = null;
            filterQuery=null;
            throw new MessageSearchException("failed to parse search query {query='"+getSearchQuery()+"'}",e,logger,ChainedException.Level.DEBUG);
          }
        } else {
          query = new MatchAllDocsQuery();
        }
        return query;
View Full Code Here

Examples of com.stimulus.archiva.exception.MessageSearchException

          Query query = filterQueryParser.parse(filterQuery);
          queryFilter = new QueryWrapperFilter(query);
          logger.debug("successfully parsed filter query {query='"+filterQuery+"'}");
      } catch (Exception pe)
      {
        throw new MessageSearchException("failed to parse search query {searchquery='"+getSearchQuery()+"'}",pe,logger,ChainedException.Level.DEBUG);
      }
      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

         for (int i=0; i < totalHits; i++) {
          results.add(new LuceneResult(searchers,topDocs.scoreDocs[i]));
         }
         logger.info("search executed successfully {query='"+getSearchQuery()+"',returnedresults='"+results.size()+"'}");
      } catch (IOException io) {
      throw new MessageSearchException("failed to execute search query {searchquery='"+getSearchQuery()+"}",io,logger,ChainedException.Level.DEBUG);
      }
    }
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.