Calling the archcheck Java API from a Java application

Content Collector for SAP supplies the sample file ArchcheckApiSample.java, which shows how to invoke the archcheck Java™ API from a Java application.

About this task

The sample file is in the following directory:
  • LinuxUNIX InstallHome/samples
  • Windows InstallHome\samples

The list of parameters that you can set by using the setter methods is the same as for the archcheck program.

Procedure

  1. Copy the archcheck.jar file to the system where you want to run the archcheck Java API.
  2. If you want to verify an HTTP connection, skip this step and start with step 3. If you want to verify an HTTPS connection, you must configure the server authentication. Complete these steps:
    1. Exporting the server certificate
    2. Import the certificate into the truststore on the system where the archcheck Java API is to run.
      Use the procedure that is described in Importing the SAP certificate into the SSL truststore.
    3. If you want to verify an HTTPS connection with client authentication, complete the following additional steps:
      1. Create a certificate for the system where the archcheck Java API is to run.
      2. Export the certificate to a file. Use the procedure that is described in Exporting the server certificate.
      3. Import the certificate into the SSL truststore on the system where Collector Server runs. Use the procedure that is described in Importing the SAP certificate into the SSL truststore.
  3. Use the ArchcheckApiSample.java file to implement the archcheck Java API call in your Java application. Then, execute your Java application.

Results

The archcheck Java API call returns a result object, which contains the status of the connection verification. For details about the status that can be returned, see Calling the archcheck Java API from a command line by using the archcheck program.