Package com.sun.enterprise.admin.util
Class HttpConnectorAddress
- java.lang.Object
-
- com.sun.enterprise.admin.util.HttpConnectorAddress
-
public final class HttpConnectorAddress extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpConnectorAddress.BasicHostnameVerifier
-
Field Summary
Fields Modifier and Type Field Description static String
AUTHORIZATION_KEY
-
Constructor Summary
Constructors Constructor Description HttpConnectorAddress()
HttpConnectorAddress(String host, int port)
HttpConnectorAddress(String host, int port, boolean secure)
construct an address which indicates the host, port and security attributes desired.HttpConnectorAddress(String host, int port, boolean secure, String path)
HttpConnectorAddress(String host, int port, boolean secure, String path, SSLSocketFactory sslSocketFactory)
HttpConnectorAddress(String host, int port, SSLSocketFactory sslSocketFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationInfo
getAuthenticationInfo()
String
getBasicAuthString()
String
getConnectorType()
get the protocol prefix to be used for a connection for the receiverString
getHost()
String
getPath()
int
getPort()
SSLSocketFactory
getSSLSocketFactory()
boolean
isSecure()
Indicate if the receiver represents a secure addressURLConnection
openConnection(String path)
Open a connection using the reciever and the given pathvoid
setAuthenticationInfo(AuthenticationInfo authInfo)
void
setHost(String host)
void
setInteractive(boolean mode)
Set the interactive mode for the connection.void
setPath(String path)
void
setPort(int port)
void
setSecure(boolean secure)
Set the security attributeURL
toURL(String path)
-
-
-
Field Detail
-
AUTHORIZATION_KEY
public static final String AUTHORIZATION_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpConnectorAddress
public HttpConnectorAddress()
-
HttpConnectorAddress
public HttpConnectorAddress(String host, int port)
-
HttpConnectorAddress
public HttpConnectorAddress(String host, int port, boolean secure)
construct an address which indicates the host, port and security attributes desired.- Parameters:
host
- a host addressport
- a port numbersecure
- a boolean indication of whether the connection should be secure (i.e. confidential) or not
-
HttpConnectorAddress
public HttpConnectorAddress(String host, int port, boolean secure, String path)
-
HttpConnectorAddress
public HttpConnectorAddress(String host, int port, SSLSocketFactory sslSocketFactory)
-
HttpConnectorAddress
public HttpConnectorAddress(String host, int port, boolean secure, String path, SSLSocketFactory sslSocketFactory)
-
-
Method Detail
-
openConnection
public URLConnection openConnection(String path) throws 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 thehostname:port
portion of a URL)- Returns:
- a connection to the required resource. The
connection returned may be a sub-class of
URLConnection
includingHttpsURLConnection
. If the sub-class is aHttpsURLConnection
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:
IOException
- if there's a problem in connecting to the resource
-
getConnectorType
public String getConnectorType()
get the protocol prefix to be used for a connection for the receiver- Returns:
- the protocol prefix - one of
http
orhttps
depending upon the security setting.
-
getHost
public String getHost()
-
setHost
public void setHost(String host)
-
getPort
public int getPort()
-
setPort
public void setPort(int port)
-
getPath
public String getPath()
-
setPath
public void setPath(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 URL toURL(String path) throws MalformedURLException
- Throws:
MalformedURLException
-
getSSLSocketFactory
public SSLSocketFactory getSSLSocketFactory()
-
getBasicAuthString
public final String getBasicAuthString()
-
-