/** 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 ... } } |
此软件包以压缩文件形式附带提供了与该主题有关的 Java CAPS 管理 API 样例,例如,AdministrationServiceSample.groovy。