Package com.stimulus.archiva.domain

Examples of com.stimulus.archiva.domain.Config


     return serviceDelegate.getStatus();
   }
  
 
    public void run() {
      Config config = Config.getConfig();
      if (config!=null) {
          for (Volume v : config.getVolumes().getVolumes()) {
                 File file = new File(v.getPath()+File.separator+Volumes.INFO_FILE);
                 // something has changed
                  if (file.exists() && v.getStatus()==Volume.Status.EJECTED ||
                    !file.exists() && v.getStatus()!=Volume.Status.EJECTED) {
                     try {
View Full Code Here


  protected Config config = null;
  protected int recoveryFailed = 0;
  protected boolean portChange = false;
 
  public ConfigBean() {
      config = new Config();
      logLevel = ConfigurationService.getLoggingLevel();
      configurationform();
     
  }
View Full Code Here

  public void init(ActionServlet actionServlet, ModuleConfig config) throws ServletException {
   
     
      logger.info("mailarchiva open source edition v"+Config.getApplicationVersion()+" started at "+new Date());
      System.setProperty("mail.mime.base64.ignoreerrors", "true");
      Config conf = ConfigurationService.getConfig();
      String appPath = actionServlet.getServletConfig().getServletContext().getRealPath("/");
       Config.setApplicationPath(appPath);
       Config.clearViewDirectory();
       Config.clearTempDirectory();
   
       try {
           conf.load();
           conf.getVolumes().startDiskSpaceCheck();
           String recover = System.getProperty("rearchive");
        if (recover!=null && recover.equalsIgnoreCase("yes"))
          MessageService.recoverNoArchiveMessages(null);
         
       } catch (Exception e) {
View Full Code Here

  protected static final String confName = "ADLogin";
  protected String lastLDAPError = "";

   public Principal authenticate(String username, String password) {
     logger.debug("authenticate. {username='"+username+"'}");
     Config config = ConfigurationService.getConfig();
     try {
       return authenticate(config, username, password);
     catch (ArchivaException ae) {
           logger.warn("failed login attempt. "+ae.getMessage()+" {username='"+username+"'}");
       }
View Full Code Here

          doc.add(new Field(efv.getField().getIndexKey()+"s",efv.getValue(),Field.Store.YES,Field.Index.UN_TOKENIZED));
           doc.add(new Field(efv.getField().getIndexKey(),efv.getValue(),Field.Store.NO,Field.Index.TOKENIZED));
         }
       }
      
       Config config = ConfigurationService.getConfig();
       if (config.getIndexMessageBody()) {
         Object bodyPart = message.getContent();
         logger.debug("writeBodyParts() begin");
         writeBodyPartsToDocument(bodyPart,bodyPart,message.getContentLanguage(),message.getContentType(), message.getDisposition(), message.getFileName(),doc,tempFiles);
         logger.debug("writeBodyParts() end");
       }
     
     String lang = doc.get("lang");
     if (lang==null) {
            lang = config.getIndexLanguage();
            logger.debug("neglected to detect language during indexing. using default language. {defaultlanguage='"+lang+"'}");
            doc.add(new Field("lang",lang,Field.Store.YES,Field.Index.UN_TOKENIZED))
          } else {
            logger.debug("language detected during indexing {language='"+lang+"'}");
        }
View Full Code Here

               logger.error(io.getMessage(),io);
           }
    }
   
    protected void addLanguage(String[] languages, Document doc, Reader detectReader) {
      Config config = ConfigurationService.getConfig();
          String lang;
            if (config.getIndexLanguageDetection() && doc.get("lang")==null) {
              try {
                if (languages!=null && languages.length>0) {
                  lang = languages[0].trim().toLowerCase(Locale.ENGLISH);
                  logger.debug("detected language from the email header. {language='"+lang+"'}");
                } else {
View Full Code Here

     */ 
   
    public boolean insertMessage(EmailID emailId, Email email) throws MessageStoreException
    {
   
        Config config = Config.getConfig();
       
       if (emailId==null || emailId.getVolume()==null || emailId.getUniqueID()==null)
           throw new MessageStoreException("assertion failure: null emailID, volume or uniqueId",logger);

       if(emailId.getUniqueID() == null)
            throw new MessageStoreException("insert message was found to have a null message id.", logger);

       logger.debug("insertMessage {"+emailId + "}");
      
       if (!config.isDefaultPassPhraseModified())
           throw new MessageStoreException("failed to archive message. encryption password is not set. {"+emailId+"}",logger);

       File messageFile = getNewFile(emailId.getVolume(),emailId.getUniqueID(),messageFileExtension);
      
      
View Full Code Here

            if (compressedStream == null)
                throw new ArchiveException("assertion failure: null message,username or remoteIP",logger,ArchiveException.RecoveryDirective.RETRYLATER);
 
            logger.debug("message received for archival (via smtp service) {"+principal+"'}");
 
            Config config = ConfigurationService.getConfig();
           
   
            /*
          try {
            File faultyFile = new File("c:\\temp.tmp");
            FileOutputStream fos = new FileOutputStream(faultyFile);
            byte[] buf = new byte[1024];
            int numRead = 0;
            while ((numRead = compressedStream.read(buf)) >= 0) {
            fos.write(buf, 0, numRead);
            }
            fos.close();
          } catch (Exception e) {
            logger.error(e);
            return;
          } 
          return;*/
         
            Email message =  null;
           
            try {
             
              if (compressed==MessageState.COMPRESSED)
                message = new Email(null,new GZIPInputStream(compressedStream));
              else
                message = new Email(null,compressedStream);
            } catch (Exception io) {
              if (io.getCause() instanceof MaxMessageSizeException) {
                logger.error("cannot process message. max message size is exceeded.",io.getCause());
                throw new ArchiveException("cannot process message. max message size is exceeded.",(MaxMessageSizeException)io.getCause(),logger,ArchiveException.RecoveryDirective.REJECT);
              }
                logger.error("archive message is corrupted. unable to parse it.",io);
               try {
                messageStore.copyEmailToNoArchiveQueue(message);
            } catch (Exception e2) {
              throw new ArchiveException("failed to copy message to the no archive queue.",e2,logger,ArchiveException.RecoveryDirective.RETRYLATER);
            }
            }
           
            if (!config.isDefaultPassPhraseModified()) {
              try {
                messageStore.copyEmailToNoArchiveQueue(message);
            } catch (Exception e2) {
              throw new ArchiveException("failed to copy message to the no archive queue.",e2,logger,ArchiveException.RecoveryDirective.RETRYLATER);
            }
            logger.error("failed to archive message. encryption password is not set.");
            }
           
           
            if (config.getArchiveRules().shouldArchive(message,ConfigurationService.getConfig().getDomains())==ArchiveRules.Action.ARCHIVE) {
             
              try {
                archive(principal,message,false);
              } catch (Exception e) {
                logger.error("error occurred while archiving message. message will be reprocessed on server restart",e);
View Full Code Here

 
    public void run() {
      if (!block) {
        try {
          Config.getConfig().getVolumes().readyActiveVolume();
          Config config = Config.getConfig();
          if (config!=null) {
              for (Volume v : config.getVolumes().getVolumes()) {
                updateEjectedStatus(v);
              }
          }
        } catch (Throwable t) {
          // this should never happen, although we never want this loop to exit
View Full Code Here

      logger.debug("getLanguage() {language='"+search.getLanguage()+"'}");
      return search.getLanguage();
  }
 
  public List getLanguages() {
      Config config = ConfigurationService.getConfig();
      Map searchAnalyzers = config.getSearchAnalyzers();
      List<String> labels = new ArrayList<String>();
      Iterator i = searchAnalyzers.entrySet().iterator();
      while (i.hasNext()) {
          Map.Entry searchAnalyzer = (Map.Entry)i.next();
          labels.add((String)searchAnalyzer.getKey());
View Full Code Here

TOP

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

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.