JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS Management and Monitoring APIs     Java CAPS Documentation
search filter icon
search icon

Document Information

Java CAPS Management and Monitoring APIs

Java CAPS Management Client

JavaDocs

Targets

Getting Started Using APIs

To Start Using APIs to Create Applications

Connecting to the Server Through APIs

Connection Type Definition

CAPSManagementClientFactory Definition

The Alert Management API

Support for Databases

AlertConfigurationService

AlertNotificationService

Services -- JavaCAPSManagementAPI

Administration Service

Runtime Management Service

Configuration Service

Deployment Service

Installation Service

Performance Measurement Service

Alert Management Service

Alert Administration Service

Alert Notification Service

Alert Configuration Service

JMS Management Service

Log Management Service

BPEL Management 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

Setting Up Databases

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

Oracle Script Examples

Setting Up Scripting Engines

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

JRuby Integrated into NetBeans IDE

To Create a JRuby Project

Connecting to the Server Through APIs

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 ...

Connection Type Definition

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();    
}

CAPSManagementClientFactory Definition

/** 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.