hudson
Class ProxyConfiguration

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<ProxyConfiguration>
      extended by hudson.ProxyConfiguration
All Implemented Interfaces:
Describable<ProxyConfiguration>, Saveable, Serializable

public final class ProxyConfiguration
extends AbstractDescribableImpl<ProxyConfiguration>
implements Saveable, Serializable

HTTP proxy configuration.

Use open(URL) to open a connection with the proxy setting.

Proxy authentication (including NTLM) is implemented by setting a default Authenticator which provides a PasswordAuthentication (as described in the Java 6 tech note Http Authentication).

See Also:
Jenkins.proxy, Serialized Form

Nested Class Summary
static class ProxyConfiguration.DescriptorImpl
           
 
Field Summary
 String name
           
 String noProxyHost
          List of host names that shouldn't use proxy, as typed by users.
 int port
           
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
ProxyConfiguration(String name, int port)
           
ProxyConfiguration(String name, int port, String userName, String password)
           
ProxyConfiguration(String name, int port, String userName, String password, String noProxyHost)
           
 
Method Summary
 Proxy createProxy()
          Deprecated. Use createProxy(String)
 Proxy createProxy(String host)
           
static Proxy createProxy(String host, String name, int port, String noProxyHost)
           
 String getEncryptedPassword()
           
static InputStream getInputStream(URL url)
           
 List<Pattern> getNoProxyHostPatterns()
          Returns the list of properly formatted no proxy host names.
static List<Pattern> getNoProxyHostPatterns(String noProxyHost)
          Returns the list of properly formatted no proxy host names.
 String getPassword()
           
 String getUserName()
           
static XmlFile getXmlFile()
           
static ProxyConfiguration load()
           
static URLConnection open(URL url)
          This method should be used wherever URL.openConnection() to internet URLs is invoked directly.
 Object readResolve()
           
 void save()
          Persists the state of this object into XML.
 
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final String name

port

public final int port

noProxyHost

public final String noProxyHost
List of host names that shouldn't use proxy, as typed by users.

See Also:
getNoProxyHostPatterns()
Constructor Detail

ProxyConfiguration

public ProxyConfiguration(String name,
                          int port)

ProxyConfiguration

public ProxyConfiguration(String name,
                          int port,
                          String userName,
                          String password)

ProxyConfiguration

@DataBoundConstructor
public ProxyConfiguration(String name,
                                               int port,
                                               String userName,
                                               String password,
                                               String noProxyHost)
Method Detail

getUserName

public String getUserName()

getPassword

public String getPassword()
Returns:
the password in plain text

getEncryptedPassword

public String getEncryptedPassword()

getNoProxyHostPatterns

public List<Pattern> getNoProxyHostPatterns()
Returns the list of properly formatted no proxy host names.


getNoProxyHostPatterns

public static List<Pattern> getNoProxyHostPatterns(String noProxyHost)
Returns the list of properly formatted no proxy host names.


createProxy

public Proxy createProxy()
Deprecated. Use createProxy(String)


createProxy

public Proxy createProxy(String host)

createProxy

public static Proxy createProxy(String host,
                                String name,
                                int port,
                                String noProxyHost)

save

public void save()
          throws IOException
Description copied from interface: Saveable
Persists the state of this object into XML.

For making a bulk change efficiently, see BulkChange.

To support listeners monitoring changes to this object, call SaveableListener.fireOnChange

Specified by:
save in interface Saveable
Throws:
IOException - if the persistence failed.

readResolve

public Object readResolve()

getXmlFile

public static XmlFile getXmlFile()

load

public static ProxyConfiguration load()
                               throws IOException
Throws:
IOException

open

public static URLConnection open(URL url)
                          throws IOException
This method should be used wherever URL.openConnection() to internet URLs is invoked directly.

Throws:
IOException

getInputStream

public static InputStream getInputStream(URL url)
                                  throws IOException
Throws:
IOException


Copyright © 2004-2013. All Rights Reserved.