Skip to main content
Java client

Install the small Java wrapper for the Ardoq REST API and create a variety of data models for your organization.

Kristine Marhilevica avatar
Written by Kristine Marhilevica
Updated over a week ago

ardoq-java-client

Small Java wrapper for the Ardoq REST-API.

ℹ️ This library is now deprecated in favour of our upcoming improved REST API. The API will be well-documented with accompanying OpenAPI specs. We encourage direct use of the REST API. Client-code can alternatively be generated from the OpenAPI specs.

Install

The client can be found in Maven Central


Add ardoq-java-client to your dependencies.

<dependencies>        ...        <dependency>            <groupId>com.ardoq</groupId>            <artifactId>java-api-client</artifactId>            <version>1.26</version>        </dependency>        ...    </dependencies>

Usage

//Basic authArdoqClient client = new ArdoqClient("hostname", "username", "password");//TokenArdoqClient client = new ArdoqClient("hostname", "token"); //Custom proxy settingsRequestConfig config = RequestConfig.custom().setProxy(new HttpHost("127.0.0.1", 9090)).build();ArdoqClient client = new ArdoqClient("hostname", "token", config);


The client will operate on the default organization (Personal). To change this

ArdoqClient client = new ArdoqClient("hostname", "username", "password").setOrganization("my-organization");

Starting a small project

ArdoqClient client = new ArdoqClient(host, ardoqUsername, ardoqPassword);Model model = client.model().getModelByName("Application service");Workspace workspace = client.workspace().createWorkspace(new Workspace("demo-workspace", model.getId(), "Description"));ComponentService componentService = client.component(); Component webshop = componentService.createComponent(new Component("Webshop", workspace.getId(), "Webshop description"));Component webShopCreateOrder = componentService.createComponent(new Component("createOrder", workspace.getId(), "Order from cart", model.getComponentTypeByName("Service"), webshop.getId())); Component erp = componentService.createComponent(new Component("ERP", workspace.getId(), ""));Component erpCreateOrder = componentService.createComponent(new Component("createOrder", workspace.getId(), "", model.getComponentTypeByName("Service"), erp.getId()));//Create a Synchronous integration between the Webshop:createOrder and ERP:createOrder servicesReference createOrderRef = new Reference(workspace.getId(), "Order from cart", webShopCreateOrder.getId(), erpCreateOrder.getId(), model.getReferenceTypeByName("Synchronous"));createOrderRef.setReturnValue("Created order");Reference reference = client.reference().createReference(createOrderRef); List<String> componentIds = Arrays.asList(webShopCreateOrder.getId(), erpCreateOrder.getId());List<String> referenceIds = Arrays.asList(reference.getId());client.tag().createTag(new Tag("Customer", workspace.getId(), "", componentIds, referenceIds)); 


Running this simple example lets Ardoq visualize the components and their relationships.

Ardoq components and relationships

Component landscape

Ardoq component landscape

Sequence diagram

Ardoq sequence diagram

Relationship diagram

Models

The model API is not stable yet, so you have to create your Model in the UI and refer to the id.

More examples

The API is pretty straightforward. For more examples, please refer to the tests.

License

Copyright © 2015 Ardoq AS

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Did this answer your question?