Package com.stimulus.archiva.domain

Examples of com.stimulus.archiva.domain.Volume


      }
     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);
      synchronized(indexLock) {
        IndexReader indexReader = null;
        try {
View Full Code Here


      Date sentBefore = defaultDate(getSentBefore(), new Date());
        List volumes = Config.getConfig().getVolumes().getVolumes();
      LinkedList<Searcher> searchers = new LinkedList<Searcher>();
      Iterator vl = volumes.iterator();
      while (vl.hasNext()) {
          Volume volume = (Volume)vl.next();
          if (volume.getModified()!=null && sentAfter.compareTo(volume.getModified())>0) {
            logger.debug("standard search: not using volume {modified='"+volume.getModified()+"', sentAfter='"+sentAfter+"',"+volume);
            continue;
          }
          if (volume.getCreated()!=null && sentBefore.compareTo(volume.getCreated())<0) {
            logger.debug("standard search: not using volume {created='"+volume.getCreated()+"', sentBefore='"+sentBefore+"',"+volume);   
            continue;
          }
          try {
              if (volume.getStatus()==Volume.Status.ACTIVE || volume.getStatus()==Volume.Status.CLOSED) {
                  Searcher volsearcher = new IndexSearcher(volume.getIndexPath());
                  searchers.add(volsearcher);
                  searcherPresent = true;
              }
          } catch (IOException io) {
              logger.error("failed to open index for search {"+volume+"}.");
View Full Code Here

        boolean success = true;
        ActionContext ctx = ActionContext.getActionContext();
        Iterator i = volumes.iterator();
        int c = 0;
        while (i.hasNext()) {
            Volume v = (Volume)i.next();
            if (!MessageService.createVolumeDirectories(v)) {
              ctx.addSimpleError(getMessage("config.volume_create_failed")+" "+c+".");
              success=false;
            }
            c++;
View Full Code Here

            j++;
        }
        j = 0;
        i = config.getVolumes().getVolumes().iterator();
        while (i.hasNext()) {
            Volume v = (Volume)i.next();
            validateRequiredField(v.getPath(), getMessage("config.volume_store_path_missing")+" "+j+".");
            validateRequiredField(v.getIndexPath(), getMessage("config.volume_index_path_missing")+" "+j+".");
            j++;
        }
       
        // active directory
       
View Full Code Here

    return searchResult.getEmailId().getUniqueID();
  }
 
  public String getVolumeID() {
    EmailID emailID = searchResult.getEmailId();
    Volume volume = emailID.getVolume();
    if (volume!=null) {
      String volumeID = volume.getID();
      return volumeID;
    } else return null;
    //return searchResult.getEmailId().getVolume().getID();
  }
View Full Code Here

      DateType dateType = getDateType();
        List volumes = Config.getConfig().getVolumes().getVolumes();
      LinkedList<Searchable> searchers = new LinkedList<Searchable>();
      Iterator vl = volumes.iterator();
      while (vl.hasNext()) {
          Volume volume = (Volume)vl.next();
          if (volume.getModified()!=null && dateType==DateType.ARCHIVEDATE && after.compareTo(volume.getModified())>0) {
            logger.debug("standard search: not using volume {modified='"+volume.getModified()+"', ater='"+after+"',"+volume);
            continue;
          }
          if (volume.getCreated()!=null && dateType==DateType.ARCHIVEDATE && before.compareTo(volume.getCreated())<0) {
            logger.debug("standard search: not using volume {created='"+volume.getCreated()+"', before='"+before+"',"+volume);   
            continue;
          }
          try {
              if (volume.getStatus()==Volume.Status.ACTIVE || volume.getStatus()==Volume.Status.CLOSED) {
                
                    Searcher volsearcher = new IndexSearcher(volume.getIndexPath());
                    searchers.add(volsearcher);
                
                  searcherPresent = true;
              }
          } catch (IOException io) {
View Full Code Here

           
          if (uid==null)  {
            logger.warn("found message with null ID during construction of search results");
            return null;
            }
          Volume volume = null;
            try {
             if (name==null) // legacy
               volume = Config.getConfig().getVolumes().getLegacyVolume(uid);
             else
               volume = Config.getConfig().getVolumes().getNewVolume(name);
View Full Code Here

   
    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);
View Full Code Here

                       indexers = new ArrayList<IndexAction>();
                      
                          for (int i=0; i<indexThreads;i++) {
                            EmailID emailId = (EmailID)indexQueue.removeLast(); // will throw exception if not found
                            logger.debug("found new message in indexing queue {"+emailId+"}");
                           Volume volume = emailId.getVolume();
                           VolumeIndex vs = getVolumeIndex(volume);
                           vs.openIndex()
                           t++;
                            IndexAction action =  new IndexAction(vs,emailId,"indexa"+t);
                                indexers.add(action);
View Full Code Here

        process.totalFileCount = 0;
        FileFilter filter = new MessageStore.MessageFileFilter(new String[] {messageFileExtension});

        // calculate total size
        while (v.hasNext()) {
          Volume volume = (Volume)v.next();
          if (volume.getStatus()!=Volume.Status.CLOSED)
            continue;
        String storePath = volume.getPath();
        //if(!storePath.endsWith(Character.toString(File.separatorChar)));
          //  storePath = storePath.substring(storePath.length() - 1);
          logger.debug("storepath:"+storePath);
          File storeDirectory = new File(storePath);
            process.totalSize += getFileSizeOrCount(storeDirectory, filter, 0);
View Full Code Here

TOP

Related Classes of com.stimulus.archiva.domain.Volume

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.