Examples of ConnectionConfig


Examples of com.google.code.lightssh.common.model.ConnectionConfig

   
    Map<String,SystemParam> paramMap = new HashMap<String,SystemParam>();
    for( SystemParam item:params )
      paramMap.put(item.getName(), item);
   
    ConnectionConfig config = new ConnectionConfig();
   
    config.setHost( getParamValue(
        paramMap,MailConfigConstants.EMAIL_HOST_KEY));
   
    config.setPort( getParamValue(
        paramMap,MailConfigConstants.EMAIL_PORT_KEY ) );
   
    config.setUsername(getParamValue(
        paramMap,MailConfigConstants.EMAIL_USERNAME_KEY ) );
   
    config.setPassword(getParamValue(
        paramMap,MailConfigConstants.EMAIL_PASSWORD_KEY ) );
   
    config.setSsl( "true".equalsIgnoreCase(getParamValue(
        paramMap,MailConfigConstants.EMAIL_SSL_KEY ) ));
   
    return config;
  }
View Full Code Here

Examples of com.google.code.lightssh.common.model.ConnectionConfig

 
  @Resource(name="emailContentManager")
  private EmailContentManager emailContentManager;
 
  protected ConnectionConfig getEmailConnectionConfig( ){
    ConnectionConfig config = null;
   
    if( systemParamManager != null ){
      config = systemParamManager.getEmailConnectionConfig();
    }
   
    if( systemConfig == null )
      return config;
   
    if( config == null ){
      config = new ConnectionConfig();
     
      config.setHost( this.systemConfig.getProperty(
          MailConfigConstants.EMAIL_HOST_KEY ) );
     
      config.setPort( this.systemConfig.getProperty(
          MailConfigConstants.EMAIL_PORT_KEY ) );
     
      config.setUsername( this.systemConfig.getProperty(
          MailConfigConstants.EMAIL_USERNAME_KEY ) );
     
      config.setPassword( this.systemConfig.getProperty(
          MailConfigConstants.EMAIL_PASSWORD_KEY ) );
     
      config.setSsl( "true".equalsIgnoreCase(systemConfig.getProperty(
          MailConfigConstants.EMAIL_SSL_KEY ) ));
    }
   
    return config;
  }
View Full Code Here

Examples of com.google.code.lightssh.common.model.ConnectionConfig

 
  /**
   * 发邮件
   */
  public void send(EmailContent ec ){
    ConnectionConfig config = getEmailConnectionConfig();
   
    MailAddress mailAddress = new MailAddress( );
    mailAddress.setFrom(config.getUsername(),config.getUsername());
   
    for( String item:ec.getAddressees())
      mailAddress.addTo(item, "");
   
    if( !StringUtils.isEmpty(ec.getCc()) ){
      for( String item:ec.getCcs())
        mailAddress.addCc(item, "");
    }
   
    boolean success = false;
    try{
      mailSender.sendHtml(config,mailAddress
          ,new MailContent(ec.getSubject(),ec.getContent()));
      success = true;
    }catch( Exception e ){
      ec.setErrMsg( TextFormater.format(e.getMessage(),197,true) );
    }
   
    ec.setSender( config.getUsername() );
   
    emailContentManager.updateStatus(success,ec);
  }
View Full Code Here

Examples of com.google.code.lightssh.common.model.ConnectionConfig

 
  /**
   * 忘记用户名
   */
  public void forgotUsername(String title, String email ){
    ConnectionConfig config = getEmailConnectionConfig();
    Address to = new Address(email,title);
    Address from = new Address(config.getUsername(),config.getUsername());
    MailAddress mailAddress = new MailAddress( to,from );
   
    StringBuffer content = new StringBuffer();
    content.append("您在系统的登录帐号为:" + title);
   
View Full Code Here

Examples of com.google.code.lightssh.common.model.ConnectionConfig

   */
  public void forgotPassword(String retrieveUrl, LoginAccount account ){
    if( account == null || StringUtils.isEmpty(account.getEmail()) )
      return ;
   
    ConnectionConfig config = getEmailConnectionConfig();
    Address to = new Address(account.getEmail(),account.getLoginName());
    Address from = new Address(config.getUsername(),config.getUsername());
    MailAddress mailAddress = new MailAddress( to,from );
   
    StringBuffer content = new StringBuffer();
    content.append("<html>");
    //content.append("<img src=\"http://www.gstatic.com/codesite/ph/images/defaultlogo.png\"></br>");
View Full Code Here

Examples of hermes.config.ConnectionConfig

          log.debug("cleaning up FactoryConfig with no connections");
          iter.remove();
          continue;
        }

        ConnectionConfig firstConnection = factoryConfig.getConnection().get(0);

        if (firstConnection.getSession().size() == 0) {
          log.debug("cleaning up FactoryConfig with no sessions");
          iter.remove();
          continue;
        }

        SessionConfig firstSession = firstConnection.getSession().get(0);

        if (firstSession.getId() == null) {
          log.debug("cleaning up FactoryConfig with a null session");
          iter.remove();
          continue;
View Full Code Here

Examples of hermes.config.ConnectionConfig

        connectionFactoryManager.addDestinationConfig(destinationConfig);
      }
    }

    if (factoryConfig.getConnection().size() > 0) {
      ConnectionConfig connectionConfig = factoryConfig.getConnection().get(0);
      ConnectionManager connectionManager = null;

      if (connectionConfig.isConnectionPerThread()) {
        connectionManager = ConnectionManagerFactory.create(ConnectionManager.Policy.CONNECTION_PER_THREAD);
      } else {
        connectionManager = ConnectionManagerFactory.create(ConnectionManager.Policy.SHARED_CONNECTION);
      }

      connectionManager.setClientID(connectionConfig.getClientID());
      connectionManager.setUsername(connectionConfig.getUsername());
      connectionManager.setPassword(connectionConfig.getPassword());

      if (connectionConfig.getSession().size() > 0) {
        SessionManager sessionManager;
        DestinationManager destinationManager;
        SessionConfig sessionConfig = connectionConfig.getSession().get(0);

        if (jndiFactory != null) {
          jndiFactory._setDelegateClassLoader(classLoader);

          destinationManager = new JNDIDestinationManager(jndiFactory._getProperties(), true);
View Full Code Here

Examples of hermes.config.ConnectionConfig

            DestinationConfig destinationConfig = (DestinationConfig) iter2.next();
         }

         for (Iterator<ConnectionConfig> iter3 = factoryConfig.getConnection().iterator(); iter3.hasNext();)
         {
            ConnectionConfig connectionConfig = iter3.next();

            for (Iterator<SessionConfig> iter4 = connectionConfig.getSession().iterator(); iter4.hasNext();)
            {

               SessionConfig sessionConfig = iter4.next();

               if (sessionConfig.getId() == null)
View Full Code Here

Examples of hermes.config.ConnectionConfig

         FactoryConfig factoryConfig = iter.next();

         for (Iterator<ConnectionConfig> iter3 = factoryConfig.getConnection().iterator(); iter3.hasNext();)
         {

            ConnectionConfig connectionConfig = iter3.next();

            for (Iterator<SessionConfig> iter4 = connectionConfig.getSession().iterator(); iter4.hasNext();)
            {

               SessionConfig sessionConfig = iter4.next();

               if (sessionConfig.getId().equals(hermesId))
View Full Code Here

Examples of hermes.config.ConnectionConfig

      {
         FactoryConfig factoryConfig = iter1.next();

         for (Iterator<ConnectionConfig> iter2 = factoryConfig.getConnection().iterator(); iter2.hasNext();)
         {
            ConnectionConfig connectionConfig = iter2.next();

            for (Iterator<SessionConfig> iter3 = connectionConfig.getSession().iterator(); iter3.hasNext();)
            {
               SessionConfig sessionConfig = iter3.next();

               rval.add(sessionConfig);
            }
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.