Java SDK Library
The Digital.ai Agility Java SDK is a library built using Java that allows object-oriented access to the Agility API, which is inherently a REST-based web service. Using the SDK you can query for simple or complex sets of information, update information, and execute system-defined operations, without having to construct HTTP requests and responses or deal with parsing the data contained in the HTTP responses. The SDK serves as a wrapper to the Agility API, eliminating the need to code the infrastructure necessary for direct handling of HTTP requests and responses.
The SDK works with the same assets and attributes that make up the rest of the Agility data model, and the same Meta API for discovering asset types. When constructing your queries, you must use the system name for the asset type you would like to retrieve. This is true whether using the API directly or the SDK.
In terms of API authentication, the SDK supports using Basic(username and password), Windows Integrated (NTLM), Access Tokens, and OAuth2.
System Requirements
The current release of the Java SDK requires JRE1.8 or higher, and Digital.ai Agility 8.0 or higher (though some features are only available with newer releases).
Getting the Java SDK
There are two ways that you can get the SDK: by using Maven to import the SDK and its dependencies from the Maven Central Repository, or by downloading the SDK and it associated dependencies from the Agility AppCatalog and setting a reference to it manually from within your project.
The recommended approach is to use Maven as it will take care of all the dependencies for you, plus make it easier to update the SDK as new versions become available.
Setting a reference using Maven
Assuming that you are using Eclipse as your IDE, use the following to steps to add the Java SDK to your project using Maven:
- Launch Eclipse and open your project.
- Edit the POM file and add the following dependency with the actual SDK version number that you want to reference:
<dependency>
<groupId>com.versionone</groupId>
<artifactId>VersionOne.SDK.Java.APIClient</artifactId>
<version>XX.X.X</version>
</dependency>
Setting a reference manually
Assuming that you are using Eclipse as your IDE, use the following to steps to manually add the Java SDK to your project:
- Download the latest stable build of the SDK from the AppCatalog page.
- Save the ZIP file to a known location on your hard drive.
- Unzip the SDK.
- Launch Eclipse and open your project.
- In the Package Explorer, right click on the project name then select Build Path, then Add External Archives.
- Navigate to the directory that you downloaded the SDK to and select theVersionOne.SDK.Java.APIClient-XX.X.X.jar file, then click Open.
While the JavaSDK is fully supported by Agility, it is also open-sourced. You can get the source code for the SDK from thisGitHub repository: https://github.com/versionone/VersionOne.SDK.Java.APIClient
Using the JavaSDK
Once you properly set a reference to the SDK within your project, using it is simply a matter of making a connection to Agility then writing the code to query, update, and create Agility assets, or execute operations against them.
The following topics discuss the major features of the SDK and demonstrate how you can make use of them:
- Creating a Connection
- Creating a Services Object
- Querying Assets
- Querying Asset History
- Querying Configurations and Localizations
- Creating Assets
- Updating Assets
- Executing Operations
- Executing Pass-Through Queries
- Working with Attachments and Images