This topic introduces you to the Java CAPS Management Client and the clients that use the API set with JBI based Java CAPS runtime and Non-JBI based Java CAPS runtime.
Scripting client — Use any JSR 223 scripting client, such as Groovy, JRuby, Jython, or JACL. See Setting Up Scripting Engines for additional information.
Groovy samples are included with the Java CAPS Release 6 delivery.
CLI client — Exercise the APIs using your own Command-line Interface client that you built using predefined functioning code, preferably Java.
Other Web/GUI clients — Exercise the APIs using your custom Web/GUI client.
Examples of Typical Client Usage
try { // Get the Management Client ManagementClient client = ManagementClientFactory.getInstance ("localhost", 4848, "admin", "adminadmin"); // Get the Administration Service AdministrationService administrationService = client.getService(AdministrationService.class); // ... Use the Administration Service ... // Get the Configuration Service ConfigurationService configurationService = client.getService(ConfigurationService.class); // ... Use the Configuration Service ... // Get the Deployment Service DeploymentService deploymentService = client.getService(DeploymentService.class); // ... Use the Deployment Service ... // Get the Installation Service InstallationService installationService = client.getService(InstallationService.class); // ... Use the Installation Service ... // Get the Runtime Management Service RuntimeManagementService runtimeManagementService = client.getService(RuntimeManagementService.class); // ... Use the Runtime Management Service ... // Get the JMS Management Service JmsManagementService jmsManagementService = client.getService(JmsManagementService.class); // ... Use the JMS Management Service ... // Get the Alert Management Service AlertManagementService alertManagementService = client.getService(AlertManagementService.class); // ... Use the Alert Management Service ... // Get the Log Management Service LogManagementService logManagementService = client.getService(LogManagementService.class); // ... Use the Log Management Service ... } catch (ManagementRemoteException exception) { // Format the exception and print it. String formattedExceptionResult= ManagementRemoteExceptionProcessor.processTaskException(exception); System.out.println(formattedExceptionResult); } |
The JavaDocs contain a complete list of all the classes in the API. They are included with the Java CAPS delivery as zipped files.
A target provides the scope of an administrative operation. Directing a command at multiple targets effectively increases the scope of that command. If multiple targets are specified, the success or failure of each target is reported separately. In other words the result of the operation on all targets is not “rolled up” into a summary status. The following table describes the scope of each target type.
Two of the target option names are constant: “domain” and “server.” They represent an instance of an operator and are replaceable with a name specific to the current template.
Target Name |
Scope |
---|---|
domain |
Command is executed against the domain itself. For JBI purposes, this is equivalent to add-to-repository activity. |
server |
Command is executed against embedded DAS server instance. |
cluster name |
Command is executed against all instances in a cluster. |
instance name |
Command is executed against a single standalone instance. |
cluster instance name |
Command is executed against the specific instance in a cluster. |
The samples that are pertinent to this topic, such as AdministrationServiceSample.groovy, are included with the delivery as zipped files.