/** Only relevant piece of code is shown */ public class CAPSManagementClientFactory { // Option 1 - host, port, userName, password public static CAPSManagementClient getInstance(String hostName, int portNumber, String userName, String password) throws ManagementRemoteException { // ... Implementation ... } // Option 2 - host, port, userName, password, connectionType public static CAPSManagementClient getInstance(String hostName, int portNumber, String userName, String password, ConnectionType connectionType) throws ManagementRemoteException { // ... Implementation ... } // Option 3 - url, userName, password, isRemoteConnection public static CAPSManagementClient getInstance(String url, String userName, String password, boolean isRemoteConnection) throws ManagementRemoteException { // ... Implementation ... } // Option 4 - MBeanServerConnection public static CAPSManagementClient getInstance(MBeanServerConnection connection) throws ManagementRemoteException { // ... Implementation ... } // Option 5 - MBeanServerConnection, isRemoteConnection public static CAPSManagementClient getInstance(MBeanServerConnection connection, boolean isRemoteConnection) throws ManagementRemoteException { // ... Implementation ... } // Option 6 - host, port, userName, password, connectionType, promtUserForMasterPassword(true/false) public static CAPSManagementClient getInstance(String hostName, int portNumber, String userName, String password, ConnectionType connectionType, boolean promptForPasswordFlag) throws ManagementRemoteException { // ... Implementation ... } // Option 7 - hostName, portNumber, userName, password, connectionType, keyStoreFileLocation, // masterPassword, promptForMasterPassword (true/false) public static CAPSManagementClient getInstance(String hostName, int portNumber, String userName, String password, ConnectionType connectionType, String trustStoreFilePath, String trustStorePassword, boolean promptForPasswordFlag) throws ManagementRemoteException { // ... Implementation ... } } |
The Java CAPS Management API samples that are pertinent to this topic, such as AdministrationServiceSample.groovy, are included with the delivery as zipped files.