Skip Navigation Links | |
Exit Print View | |
Oracle Java CAPS Management and Monitoring APIs Java CAPS Documentation |
Java CAPS Management and Monitoring APIs
To Start Using APIs to Create Applications
Services -- JavaCAPSManagementAPI
Performance Measurement Service
Master Data Management (MDM) Service
Java CAPS Adapters Management Service
Target Option Behavior for the Management Client
Writing Java Code to Access APIs Using Java Code Samples
To Set Up a Database Using Enterprise Manager
To Set Up a Database Using a Scripting Utility
Using Oracle and Other Databases for Alert Persistence
To Set Up an Oracle Database for Alert Persistence
Downloading, Installing, and Setting Up A Scripting Environment
Setting Up a Scripting Environment to Invoke Java CAPS Management and Monitoring APIs
To Modify the Environment Variables in env.bat
Using a Scripting Language to Exercise the Java CAPS Management and Monitoring APIs
Exercising the Administration Service
Exercising the Administration Service in Groovy
Exercising the Configuration Service
Exercising the Configuration Service in Groovy
Exercising the Deployment Service
Exercising the Deployment Service in Groovy
Exercising the Installation Service
Exercising the Installation Service in Groovy
Exercising the Runtime Management Service
Exercising the Runtime Management Service in Groovy
Exercising the JMS Management Service
Exercising the JMS Management Service in Groovy
Exercising the BPEL Management Service
Exercising the BPEL Management Service in Groovy
Exercising the HTTP Administration Service
Exercising the HTTP Administration Service in Groovy
Exercising the Notification Service
Exercising the Notification Service in Groovy
Java CAPS currently provides seven options for you to connect to the GlassFish Application Server using APIs.
CAPSManagementClientFactory Client Usage
Option 1: host, port, userName, password
/** Only relevant piece of code is shown */ ManagementClient client = CAPSManagementClientFactory.getInstance("127.0.0.1", 4848, "admin", "adminadmin"); // ... Invoke operations on the returned CAPSManagementClient object ...
Option 2: host, port, userName, password, connectionType
/** Only relevant piece of code is shown */ ManagementClient client = CAPSManagementClientFactory.getInstance("127.0.0.1", 4848, "admin", "adminadmin", ConnectionType.HTTP); // ... Invoke operations on the returned CAPSManagementClient object ...
Option 3: url, userName, password, isRemoteConnection
/** Only relevant piece of code is shown */ ManagementClient client = CAPSManagementClientFactory.getInstance( "service:jmx:rmi:///jndi/rmi://localhost:22287/management/rmi-jmx- connector", "admin", "adminadmin", false); // ... Invoke operations on the returned CAPSManagementClient object ...
Option 4: MBeanServerConnection
/** Only relevant piece of code is shown */ MBeanServerConnection connection = ... // Get the MBeanServerConnection ManagementClient client = CAPSManagementClientFactory.getInstance(connection); // ... Invoke operations on the returned CAPSManagementClient object ...
Option 5: MBeanServerConnection, isRemoteConnection (true/false)
/** Only relevant piece of code is shown */ MBeanServerConnection connection = ... // Get the MBeanServerConnection ManagementClient client = CAPSManagementClientFactory.getInstance(connection, true); // ... Invoke operations on the returned CAPSManagementClient object ...
Option 6: host, port, userName, password, connectionType, promtUserForMasterPassword(true/false)
/** Only relevant piece of code is shown */ ManagementClient client = CAPSManagementClientFactory.getInstance("127.0.0.1", 8686, "admin", "adminadmin", ConnectionType.JRMP, false); // ... Invoke operations on the returned CAPSManagementClient object ...
Option 7: hostName, portNumber, userName, password, connectionType, keyStoreFileLocation, masterPassword, promptForMasterPassword (true/false)
/** Only relevant piece of code is shown */ ManagementClient client = CAPSManagementClientFactory.getInstance ("127.0.0.1", 8686, "admin", "adminadmin", ConnectionType.JRMP, "C:/CAPS6/Glassfish/ domains/domain1/ config/keystore.jks", "changeit", true); // ... Invoke operations on the returned CAPSManagementClient object ...
public enum ConnectionType { HTTP("s1ashttp"), HTTPS("s1ashttps"), JRMP("jmxrmi"), IIOP("iiop"); // ... Implementation ... /** @return the protocol */ public String getProtocol(); /** @return the protocol description */ public String getDescription(); }
/** 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 ... } }
Note - The Java CAPS Management API samples that are pertinent to this topic, such as AdministrationServiceSample.groovy, are included with the delivery as zipped files.