Package com.sun.enterprise.admin.util
Class HttpConnectorAddress
java.lang.Object
com.sun.enterprise.admin.util.HttpConnectorAddress
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpConnectorAddress(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
Modifier and TypeMethodDescriptionget the protocol prefix to be used for a connection for the receivergetHost()getPath()intgetPort()booleanisSecure()Indicate if the receiver represents a secure addressopenConnection(String path) Open a connection using the reciever and the given pathvoidsetAuthenticationInfo(AuthenticationInfo authInfo) voidvoidsetInteractive(boolean mode) Set the interactive mode for the connection.voidvoidsetPort(int port) voidsetSecure(boolean secure) Set the security attribute
-
Field Details
-
AUTHORIZATION_KEY
- See Also:
-
-
Constructor Details
-
HttpConnectorAddress
public HttpConnectorAddress() -
HttpConnectorAddress
-
HttpConnectorAddress
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
-
HttpConnectorAddress
-
HttpConnectorAddress
public HttpConnectorAddress(String host, int port, boolean secure, String path, SSLSocketFactory sslSocketFactory)
-
-
Method Details
-
openConnection
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:portportion of a URL)- Returns:
- a connection to the required resource. The connection returned may be a sub-class of
URLConnectionincludingHttpsURLConnection. If the sub-class is aHttpsURLConnectionthen 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
get the protocol prefix to be used for a connection for the receiver- Returns:
- the protocol prefix - one of
httporhttpsdepending upon the security setting.
-
getHost
-
setHost
-
getPort
public int getPort() -
setPort
public void setPort(int port) -
getPath
-
setPath
-
getAuthenticationInfo
-
setAuthenticationInfo
-
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
- Throws:
MalformedURLException
-
getSSLSocketFactory
-
getBasicAuthString
-