Programming with the Java API
Java API requirements
To build and run a BMC Remedy AR System Java API program on either Windows or UNIX, you need the following environment components:
- J2SE Software Development Kit (SDK), version 5 (1.5.0_06) or higher
- Java API files:
- arapiVerNum.jar
- arjniVerNum.dll/libarjniVerNum.a
- arjniVerNum.dll/libarjniVerNum.sl
- arjniVerNum.dll/libarjniVerNum.so
- arsys_sample.xml
- log4j.xml
- log4j-1.2.14.jar
- websvcjavaVerNum.jar
In these file names, the placeholder VerNum represents the version number of the release. In some cases, this includes a build number. For example, in release 7.6.02, the AR System API file is named arapi7602.jar or arapi7602_build001.jar. The BMC Remedy AR System API OSGI bundle can be utilized in an OSGI deployment environment.
Note
The BMC Remedy AR System Java API also uses a Java Native Interface (JNI) library and the C API library to connect to a pre-7.0.01 BMC Remedy AR System server. You can control when the JNI library is used by setting the jniLoadMode parameter in the Java API configuration file. See the comments in the sample file, arsys_sample.xml.
To write the Java program
Follow these steps to write the program:
- Ensure your programming environment is set up correctly as described in the Java API requirements section.
- Create a Java project in your IDE.
- Include the arapiVerNum.jar and the other required JAR files in the BMC Remedy AR System API lib directory in the class path.
- Create a new class for the methods that call the Java API.
- Import the com.bmc.arsys.api package and other packages you might use in your program. The API uses collection classes, so you are likely to need java.util.ArrayList, java.util.List, and java.util.Map.
- Instantiate an ARServerUser object. Set the user name, password, server, and other connection attributes. If the program needs to interact with different servers or as different users, it can create more than one ARServerUser object.
- Use the ARServerUserlogin method to open the connection to the server.
- Perform the required operations using the ARServerUser methods and other API objects and methods to create, retrieve, update, and delete BMC Remedy AR System system objects as needed and creating criteria objects and using server object methods as required.
- Use the ARServerUserlogout method to close the connection to the server.
For BMC Remedy AR System Java API troubleshooting information, see Troubleshooting the Java API.
Comments
Which java API I can use to import definition file.
Hi Rajeev,
Thank you for your comment. You can use the ARDefinitionImporter class to import definition files.
The Java documentation file ardoc91_build JAR file contains more information about the API integration with the Remedy server. This file is available with the Remedy installers.
Hope this helps.
Regards,
Himanshu
Log in or register to comment.