HPE Operations Agent provides a set of Java classes to generate messages for open message interface policies. The classes can be used to generate messages from within a Java program.
Note: The Java classes can also be used to acknowledge previously generated messages, and to send monitor values to the HPE Operations Agent. Operations Connector does not support these uses.
The JAR files jopcagtbase.jar and jopcagtmsg.jar that are necessary to use the APIs are installed as part of HPE Operations Agent on the Operations Connector server at:
Windows: %OvInstallDir%\java
Linux: /opt/OV/java
To use the Java classes:
The -classpath parameter used for the javac and java commands must include the jopcagtbase.jar and jopcagtmsg.jar files.
The PATH system variable must include the directory where the shared library files reside. The agent installation does this automatically.
Javadoc style class documentation is available at the following location:
Windows: %OvInstallDir%\www\htdocs\jdoc_agent\index.html
Linux: /opt/OV/www/htdocs/jdoc_agent/index.html
For more information, see the section "Java API" in the HPE Operations Agent Reference Guide PDF.
Examples of how the API classes can be used from Java are available in the following directory on the Operations Connector server:
Windows: %OvInstallDir%\examples\jopcagtapi
Linux: /opt/OV/OpC/examples/jopcagtapi
Change to the folder %OvInstallDir%/examples/jopcagtapi on the Operations Connector server.
Compile the example code, type:
javac -classpath "%OvInstallDir%/java/jopcagtbase.jar:%OvInstallDir%/java/jopcagtmsg.jar" JOpcAgtMsgTest.java
Run the example code, type:
java -classpath ".:%OvInstallDir%/java/jopcagtbase.jar:%OvInstallDir%/java/jopcagtmsg.jar" JOpcAgtMsgTest
Change to the directory /opt/OV/OpC/examples/jopcagtapi on the Operations Connector server.
Compile the example code, type:
javac -classpath "/opt/OV/java/jopcagtbase.jar:/opt/OV/java/jopcagtmsg.jar" JOpcAgtMsgTest.java
Run the example code, type:
java -classpath ".:/opt/OV/java/jopcagtbase.jar:/opt/OV/java/jopcagtmsg.jar" JOpcAgtMsgTest