com.sun.enterprise.admin.util
Class HttpConnectorAddress

java.lang.Object
  extended by com.sun.enterprise.admin.util.HttpConnectorAddress

public final class HttpConnectorAddress
extends java.lang.Object


Field Summary
static java.lang.String AUTHORIZATION_KEY
           
 
Constructor Summary
HttpConnectorAddress()
           
HttpConnectorAddress(javax.net.ssl.SSLSocketFactory sslSocketFactory)
           
HttpConnectorAddress(java.lang.String host, int port)
           
HttpConnectorAddress(java.lang.String host, int port, boolean secure)
          construct an address which indicates the host, port and security attributes desired.
HttpConnectorAddress(java.lang.String host, int port, boolean secure, java.lang.String path)
           
HttpConnectorAddress(java.lang.String host, int port, boolean secure, java.lang.String path, javax.net.ssl.SSLSocketFactory sslSocketFactory)
           
HttpConnectorAddress(java.lang.String host, int port, javax.net.ssl.SSLSocketFactory sslSocketFactory)
           
 
Method Summary
 AuthenticationInfo getAuthenticationInfo()
           
 java.lang.String getBasicAuthString()
           
 java.lang.String getConnectorType()
          get the protocol prefix to be used for a connection for the receiver
 java.lang.String getHost()
           
 java.lang.String getPath()
           
 int getPort()
           
 javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
           
 boolean isSecure()
          Indicate if the receiver represents a secure address
 java.net.URLConnection openConnection(java.lang.String path)
          Open a connection using the reciever and the given path
 java.net.URLConnection openConnection(java.net.URL url)
           
 void setAuthenticationInfo(AuthenticationInfo authInfo)
           
 void setHost(java.lang.String host)
           
 void setInteractive(boolean mode)
          Set the interactive mode for the connection.
 void setPath(java.lang.String path)
           
 void setPort(int port)
           
 void setSecure(boolean secure)
          Set the security attribute
 java.net.URL toURL(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTHORIZATION_KEY

public static final java.lang.String AUTHORIZATION_KEY
See Also:
Constant Field Values
Constructor Detail

HttpConnectorAddress

public HttpConnectorAddress()

HttpConnectorAddress

public HttpConnectorAddress(javax.net.ssl.SSLSocketFactory sslSocketFactory)

HttpConnectorAddress

public HttpConnectorAddress(java.lang.String host,
                            int port)

HttpConnectorAddress

public HttpConnectorAddress(java.lang.String host,
                            int port,
                            boolean secure)
construct an address which indicates the host, port and security attributes desired.

Parameters:
host - a host address
port - a port number
secure - a boolean indication of whether the connection should be secure (i.e. confidential) or not

HttpConnectorAddress

public HttpConnectorAddress(java.lang.String host,
                            int port,
                            boolean secure,
                            java.lang.String path)

HttpConnectorAddress

public HttpConnectorAddress(java.lang.String host,
                            int port,
                            javax.net.ssl.SSLSocketFactory sslSocketFactory)

HttpConnectorAddress

public HttpConnectorAddress(java.lang.String host,
                            int port,
                            boolean secure,
                            java.lang.String path,
                            javax.net.ssl.SSLSocketFactory sslSocketFactory)
Method Detail

openConnection

public java.net.URLConnection openConnection(java.lang.String path)
                                      throws java.io.IOException
Open a connection using the reciever and the given path

Parameters:
path - the path to the required resource (path here is the portion after the hostname:port portion of a URL)
Returns:
a connection to the required resource. The connection returned may be a sub-class of URLConnection including HttpsURLConnection. If the sub-class is a HttpsURLConnection then this connection will accept any certificate from any server where the server's name matches the host name of this object. Specifically we allows the certificate not to contain the name of the server. This is a potential security hole, but is also a usability enhancement.
Throws:
java.io.IOException - if there's a problem in connecting to the resource

getConnectorType

public java.lang.String getConnectorType()
get the protocol prefix to be used for a connection for the receiver

Returns:
the protocol prefix - one of http or https depending upon the security setting.

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

getPort

public int getPort()

setPort

public void setPort(int port)

getPath

public java.lang.String getPath()

setPath

public void setPath(java.lang.String path)

getAuthenticationInfo

public AuthenticationInfo getAuthenticationInfo()

setAuthenticationInfo

public void setAuthenticationInfo(AuthenticationInfo authInfo)

setSecure

public void setSecure(boolean secure)
Set the security attribute


isSecure

public boolean isSecure()
Indicate if the receiver represents a secure address


setInteractive

public void setInteractive(boolean mode)
Set the interactive mode for the connection.


toURL

public java.net.URL toURL(java.lang.String path)
                   throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getSSLSocketFactory

public javax.net.ssl.SSLSocketFactory getSSLSocketFactory()

openConnection

public java.net.URLConnection openConnection(java.net.URL url)
                                      throws java.io.IOException
Throws:
java.io.IOException

getBasicAuthString

public final java.lang.String getBasicAuthString()


Copyright © 2012 GlassFish Community. All Rights Reserved.