The ALM Octane Java SDK

The ALM Octane SDK consists of a set of Java libraries, a sample project, documentation, and examples to help you integrate with ALM Octane.

Get ready

Requirements

The following requirements and prerequisites are necessary for working with the ALM Octane Java SDK.

Java

8.0 and later

ALM Octane 12.53.16 and later

Preparations

Prepare the following items in advance. You need them to work with the ALM Octane SDK.

  • The URL of your ALM Octane server.

  • The shared space ID.

  • Workspace IDs.

Back to top

Download and install

Downloading the Java SDK from one of the following locations:

Location Description
Maven You can download the Java SDK libraries and samples from the Maven repositories using project object model (POM) file. Maven includes all dependencies automatically when you download the ALM Octane Java SDK.
GitHub You can download the source files from the GitHub repository. You can also use this method to contribute to the repository.

Maven

The SDK comprises the following Maven modules within the main project:

Module Description
sdk-root This is the main root of the SDK. It contains all integration tests, source code, and examples.
sdk-src The root of the main SDK. Add only this module if you only want to consume the SDK.
sdk-integration-tests The module used for running integration tests from the SDK against your ALM Octane instance.
sdk-usage-examples Some simple examples of how to use the SDK.

To work with Maven, add the following dependency to your project in your pom.xml file:

<dependency>
    <groupId>com.hpe.adm.nga.sdk</groupId>
    <artifactId>sdk-src</artifactId>
    <version>12.55.8</version>
</dependency>

See https://maven.apache.org for more information.

GitHub

The SDK repository can be found at:

https://github.com/MicroFocus/alm-octane-js-rest-sdk

There you will see information about how to compile the project and create Javadoc.

Back to top

Authenticate

To use the ALM Octane Java SDK, you must authenticate, as you would when working directly with the REST API. For details, see Authenticating.

Back to top

Access Javadocs

Javadocs are HTML documentation generated from Java source code. Javadocs describe: 

  • Classes and methods

  • Parameters and return values

  • Deprecated classes and methods

  • Class hierarchy

If you download from Maven, you can download a pre-packaged jar with the Javadocs inside them from:

http://repo1.maven.org/maven2/com/hpe/adm/nga/sdk/sdk-src/12.53.16/sdk-src-12.53.16-javadoc.jar

Alternatively if you download the source files from GitHub, you can create the Javadocs yourself. See the README file on GitHub for more information.

Back to top

The sample project

The ALM Octane Java SDK provides a sample project that can be used for practice. The examples here are based on this sample project.

Access the sample project

To access the sample project, enter this URL: https://github.com/MicroFocus/ALMOctaneJavaRESTSDK/tree/master/sdk-usage-examples

Familiarize yourself with the sample project

Open the project in ALM Octane and become familiar with the data and entities.

Sample Description

CreateContextExample.java

This example shows out to create the context in which the REST API functions operate.

  • Authentication can be by user and password, or by API access key. This example demonstrates authentication by user and password. All subsequent REST API actions are performed only if this user has the appropriate permissions.

  • The example then sets the URL for the ALM Octane server, the space, and workspace.

  • Next, a basic get is performed for all defects in this context.

EntityExample.java

This example demonstrates how to work with entities using the REST API. For demo purposes, the example works with defects, but the same examples can be used with other entities.

  • GET the values for a specific defect whose ID is 2010.

  • Filter the values by creation time.

  • Specify which fields to display and in what order.

  • Query all entities whose IDs are equal to the string 2.

  • Perform a cross-filter query

MetadataExample.java

This example demonstrates how to get metadata for all fields.

Back to top