Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
Java RMI clients
A Java Remote Invocation (RMI) client can call the methods of the SA API from a server that has network access to the SA core. The server running the client does not have to be an SA core or managed server. When it connects to the core, the client specifies an SA user name and password, much like an end user logging on with the SA Client. The group that the user belongs to determines which SA resources and tasks are available to the client.
This topic is intended for software developers who are familiar with SA fundamentals and the Java programming language.
Setup for Java RMI clients
Before developing Java RMI clients for the SA API, perform the following steps:
- Install an SA core in a development environment. Do not use a production core.
- Obtain a development server where you will build and run the Java RMI client.
- On the development server, install the Java SE 7 SDK.
- Verify that the development server has a network connection to the SA core server that runs the OCC component.
- Download the
opswclient.jar
file from the SA core server to your development server. Theopswclient.jar
file contains the Java RMI stubs for the SA API. You include theopswclient.jar
in theclasspath
option when compiling and running Java RMI clients. - To download
opswclient.jar
do one of the following:- Specify the following URL, where occ_host is the core server running the OCC component:
https://occ_host/twister/opswclient.jar
- Go to the following directory:
/opt/opsware/twist/extlib/client
.
- Specify the following URL, where occ_host is the core server running the OCC component:
You also need the spinclient-latest.jar
and the opsware_common-latest.jar
files. These files can be obtained from a running SA Core in:
/opt/opsware/twist/lib/
You must also add these .jar
files to the classpath parameter when compiling and running these examples.
Sample Java RMI
This section describes a simple Java RMI client named GetServerInfo
.
The GetServerInfo
client searches for managed servers by full or partial host name, which you specify as a command-line argument. For each managed server found, the client prints out the server’s name, management IP address, and OS version.
The GetServerInfo
client performs the following steps:
- Connects to SA:
// Set the JNDI provider
client.setJNDIProvider( "https" , host , ( short ) 1032 , null, newString[] { OPSWARE_CA_CRT_PATH } , null ) ;
// Force a reconnection
client.getContext( true ) ;
// Set and authenticate the user
client.setAPIUser( new APIUserImpl(username , password)) ; - Gets a reference to the ServerService interface:
serverSvc = (ServerService)OpswareClient.getService
(ServerService.class); - Invokes methods on
ServerService
:ServerRef[] serverRefs = serverSvc.findServerRefs(filter);
. . .
ServerVO[] serverVOs = serverSvc.getServerVOs(serverRefs);
. . .
System.out.println(serverVOs[i].getName());
Compiling and running the GetServerInfo example
Before compiling and running the example, perform the following tasks:
- Obtain the
opsware_common-latest.jar
,spinclient-latest.jar
andopswclient.jar
files, as described in Setup for Java RMI clients. - Download the ZIP file that contains the demo program
GetServerInfo.java
file. For information about downloading the demo file, see Platform Developer Guide examples. - To compile the client, specify the
opsware_common-latest.jar
,spinclient-latest.jar
andopswclient.jar
files for theclasspath
parameter:javac -classpath :path/opswclient.jar:path/opsware_common-latest.jar:path/spinclient-latest.jar GetServerInfo.java
- To run the client, enter the following command, where target is the full or partial name of a server managed by SA. Note: the Java classpath separator for windows is "
;
".java -classpath .:path/opswclient.jar:path/opsware_common-latest.jar:path/spinclient-latest.jar \GetServerInfo [options] target
In the following example,GetServerInfo
connects to SA on hostc44
(where the OCC core component runs) and port 443. The program displays information for managed servers with hostnames that contain the stringopsw
.java -classpath .:/home/jdoe/opswclient.jar:/home/jdoe/opsware_common-latest.jar:/home/jdoe/spinclient-latest.jar \GetServerInfo --host c44.dev.example.com --port 443 opsw
- Respond to the prompts for the SA user name and password. The SA user must have read permissions for the servers that match the target specified on the command line.
Possible issue on Windows
The SA Java RMI Client, opswclient.jar, might not work on Windows if your SA certificates are using an SHA-224 signature algorithm. This is caused by the following JDK change: Remove SHA224 from the default support list if SunMSCAPI enabled.
Workaround: Disable the SunMSCAPI security provider. This restores support for SHA-224 in the JDK. To disable the SunMSCAPI provider either:
- edit
<JRE_HOME>/lib/security/java.security
and comment out the line that defines the SunMSCAPI provider OR - disable the SunMSCAPI provider programatically by using the
java.security.Security.removeProvider()
method.
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to hpe_sa_docs@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: