class HopServer extends ChangedFlag implements Cloneable, IVariables, IXml, IHopMetadata {

  private void addCredentials( HttpClientContext context ) {

    String host = environmentSubstitute( hostname );
    int port = Const.toInt( environmentSubstitute( this.port ), 80 );
    String userName = environmentSubstitute( username );
    String password = Encr.decryptPasswordOptionallyEncrypted( environmentSubstitute( this.password ) );
    String proxyHost = environmentSubstitute( proxyHostname );

    CredentialsProvider provider = new BasicCredentialsProvider();
    UsernamePasswordCredentials credentials = new UsernamePasswordCredentials( userName, password );
    if ( !Utils.isEmpty( proxyHost ) && host.equals( "localhost" ) ) {
      host = "127.0.0.1";
    }
    provider.setCredentials( new AuthScope( host, port ), credentials );
    context.setCredentialsProvider( provider );
    // Generate BASIC scheme object and add it to the local auth cache
    HttpHost target = new HttpHost( host, port, isSslMode() ? HTTPS : HTTP );
    AuthCache authCache = new BasicAuthCache();
    BasicScheme basicAuth = new BasicScheme();
    authCache.put( target, basicAuth );
    context.setAuthCache( authCache );
  }

  public  HopServer();
  public  HopServer( String name, String hostname, String port, String username, String password );
  public  HopServer( String name, String hostname, String port, String username, String password,
                    String proxyHostname, String proxyPort, String nonProxyHosts );
  public  HopServer( String name, String hostname, String port, String username, String password,
                    String proxyHostname, String proxyPort, String nonProxyHosts, boolean sslMode );
  public  HopServer( Node node );

}