org.sonatype.aether.repository
Class Proxy

java.lang.Object
  extended by org.sonatype.aether.repository.Proxy

public final class Proxy
extends Object

A proxy to use for connections to a repository. Note: Instances of this class are immutable and the exposed mutators return new objects rather than changing the current instance.

Author:
Benjamin Bentmann

Field Summary
static String TYPE_HTTP
          Type denoting a proxy for HTTP transfers.
static String TYPE_HTTPS
          Type denoting a proxy for HTTPS transfers.
 
Constructor Summary
Proxy(String type, String host, int port, Authentication auth)
          Creates a new proxy with the specified properties.
 
Method Summary
 boolean equals(Object obj)
           
 Authentication getAuthentication()
          Gets the authentication to use for the proxy connection.
 String getHost()
          Gets the host for this proxy.
 int getPort()
          Gets the port number for this proxy.
 String getType()
          Gets the type of this proxy.
 int hashCode()
           
 Proxy setAuthentication(Authentication auth)
          Sets the authentication to use for the proxy connection.
 Proxy setHost(String host)
          Sets the host of the proxy.
 Proxy setPort(int port)
          Sets the port number for the proxy.
 Proxy setType(String type)
          Sets the type of the proxy.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_HTTP

public static final String TYPE_HTTP
Type denoting a proxy for HTTP transfers.

See Also:
Constant Field Values

TYPE_HTTPS

public static final String TYPE_HTTPS
Type denoting a proxy for HTTPS transfers.

See Also:
Constant Field Values
Constructor Detail

Proxy

public Proxy(String type,
             String host,
             int port,
             Authentication auth)
Creates a new proxy with the specified properties.

Parameters:
type - The type of the proxy, e.g. "http", may be null.
host - The host of the proxy, may be null.
port - The port of the proxy.
auth - The authentication to use for the proxy connection, may be null.
Method Detail

getType

public String getType()
Gets the type of this proxy.

Returns:
The type of this proxy, never null.

setType

public Proxy setType(String type)
Sets the type of the proxy.

Parameters:
type - The type of the proxy, e.g. "http", may be null.
Returns:
The new proxy, never null.

getHost

public String getHost()
Gets the host for this proxy.

Returns:
The host for this proxy, never null.

setHost

public Proxy setHost(String host)
Sets the host of the proxy.

Parameters:
host - The host of the proxy, may be null.
Returns:
The new proxy, never null.

getPort

public int getPort()
Gets the port number for this proxy.

Returns:
The port number for this proxy.

setPort

public Proxy setPort(int port)
Sets the port number for the proxy.

Parameters:
port - The port number for the proxy.
Returns:
The new proxy, never null.

getAuthentication

public Authentication getAuthentication()
Gets the authentication to use for the proxy connection.

Returns:
The authentication to use or null if none.

setAuthentication

public Proxy setAuthentication(Authentication auth)
Sets the authentication to use for the proxy connection.

Parameters:
auth - The authentication to use, may be null.
Returns:
The new proxy, never null.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2010-2012. All Rights Reserved.