Package com.stimulus.archiva.security.realm

Examples of com.stimulus.archiva.security.realm.MailArchivaPrincipal


 
  public static class WriteMessageCallback implements StoreMessageCallback {
   
    public void store(InputStream is, String remoteIP) throws ArchiveException {
        String userName = "smtpservice";
         MailArchivaPrincipal mp = new MailArchivaPrincipal(userName,userName,null,remoteIP);
        
         logger.debug("storeMessage (via smtp service)");
         logger.info("message received for archival (via smtp service)) {username='"+userName+"', client ip='"+remoteIP+"'}");
           try {
               storeMessage(mp,is,MessageState.UNCOMPRESSED);
View Full Code Here


        String searchQuery = search.getSearchQuery();
        logger.debug("search() {searchquery='"+searchQuery+"'}");
        search.clearResults();
        long s = (new Date()).getTime();
        remoteHost = ActionContext.getActionContext().getRequest().getRemoteHost();
        MailArchivaPrincipal cp = (MailArchivaPrincipal)ActionContext.getActionContext().getRequest().getUserPrincipal();
        if (cp!=null) {
            userName = cp.getName();
            userRole = cp.getRole();
            emailAddresses = cp.getEmailAddresses();
            search.setUserName(userName);
          search.setUserRole(userRole);
          search.setEmailAddresses(emailAddresses);
          audit.info("search email {query="+searchQuery.trim()+", remotehost="+remoteHost+", uname="+userName+"}");
          SearchService.searchMessage(search);
View Full Code Here

  }
 
  public static String testAuthenticate(Config config, String username, String password)  {
      ADRealm ar = new ADRealm();
      //Principal p = ar.authenticate(username,password);
      MailArchivaPrincipal cgp = null;
      try {
          cgp = (MailArchivaPrincipal)ar.authenticate(config,username,password);
          if (cgp!=null) {
              String roleName = cgp.getRole();
              return "Authentication success. Role "+roleName+" is assigned.";
          } else
              return "Authentication failed.";
      } catch (ArchivaException ae) {
          return "Authentication failed. "+ae.getMessage()+".";
View Full Code Here

    return translateList(srcList,false);
  }
 
  public MailArchivaPrincipal getMailArchivaPrincipal() {
     String remoteHost = ActionContext.getActionContext().getRequest().getRemoteHost();
      MailArchivaPrincipal cp = (MailArchivaPrincipal)ActionContext.getActionContext().getRequest().getUserPrincipal();   
      if (cp!=null)
        cp.setIpAddress(remoteHost);
      return cp;
  }
View Full Code Here

TOP

Related Classes of com.stimulus.archiva.security.realm.MailArchivaPrincipal

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.