class SlaveServer extends ChangedFlag implements Cloneable, SharedObjectInterface, VariableSpace,
  RepositoryElementInterface, XMLInterface {

  private void addCredentials( HttpClientContext context ) {
    String userName;
    String password;
    String host;
    int port;
    String proxyHost;
    lock.readLock().lock();
    try {
      host = environmentSubstitute( hostname );
      port = Const.toInt( environmentSubstitute( this.port ), 80 );
      userName = environmentSubstitute( username );
      password = Encr.decryptPasswordOptionallyEncrypted( environmentSubstitute( this.password ) );
      proxyHost = environmentSubstitute( proxyHostname );
    } finally {
      lock.readLock().unlock();
    }
    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, "http" );
    AuthCache authCache = new BasicAuthCache();
    BasicScheme basicAuth = new BasicScheme();
    authCache.put( target, basicAuth );
    context.setAuthCache( authCache );
  }

  public  SlaveServer();
  public  SlaveServer( String name, String hostname, String port, String username, String password );
  public  SlaveServer( String name, String hostname, String port, String username, String password,
                      String proxyHostname, String proxyPort, String nonProxyHosts, boolean master );
  public  SlaveServer( String name, String hostname, String port, String username, String password,
                      String proxyHostname, String proxyPort, String nonProxyHosts, boolean master, boolean ssl );
  public  SlaveServer( Node slaveNode );

}