|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.appserv.management.helper.Connect
public class Connect
Miscellaneous helper routines for connecting to the Appserver.
Method Summary | |
---|---|
static AppserverConnectionSource |
connectNoTLS(String host,
int port,
String user,
String userPassword)
|
static AppserverConnectionSource |
connectTLS(String host,
int port,
String user,
String userPassword,
boolean promptForUnknownCertificate)
Connect to an Appserver using TLS (SSL) using the default TrustStore and default TrustStore password. |
static TLSParams |
createTLSParams(File trustStore,
String trustStorePasswordIn,
boolean promptForUnknownCertificate)
Get TLSParams for the specified truststore and password. |
static TLSParams |
createTLSParams(String trustStorePassword,
boolean promptForNewCertificate)
Get TLSParams for the default truststore, assuming the default password. |
static File |
getDefaultTrustStore()
The File will use the name AppserverConnectionSource.DEFAULT_TRUST_STORE_NAME
in the user's home directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AppserverConnectionSource connectTLS(String host, int port, String user, String userPassword, boolean promptForUnknownCertificate) throws IOException
If the server certificate is unknown, prompting will occur via System.out if 'promptForNewCertificate' is true; otherwise the connection will be rejected.
If a new server certificate is found, and the user enters "yes", then it is added to the default truststore.
host
- hostname or IP addressport
- port to which to connectuser
- admin user nameuserPassword
- password for specified userpromptForUnknownCertificate
- prompts via System.out if the server
certificate is unrecognized, otherwise rejects the connection
IOException
public static AppserverConnectionSource connectNoTLS(String host, int port, String user, String userPassword) throws IOException
IOException
public static File getDefaultTrustStore()
AppserverConnectionSource.DEFAULT_TRUST_STORE_NAME
in the user's home directory.
public static TLSParams createTLSParams(String trustStorePassword, boolean promptForNewCertificate)
trustStorePassword
- a truststore, or null for the default onepromptForNewCertificate
- public static TLSParams createTLSParams(File trustStore, String trustStorePasswordIn, boolean promptForUnknownCertificate)
A HandshakeCompletedListener
is installed which may be obtained
by calling TLSParams.getHandshakeCompletedListener()
.
If a new server certificate is found, and the user enters "yes" in response to prompting, then the certificate is added to the truststore.
trustStore
- a truststore, or null for the default onetrustStorePasswordIn
- the truststore password, if null the default one will be usedpromptForUnknownCertificate
- prompts via System.out if the server
certificate is unrecognized
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.