JDF JBoss Stacks Client API
Java Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


JDF JBoss Stacks Client API

What is it?

This a client for JBoss Stacks YAML file.

How to use this API ?

If you need to convert the stack.yaml file to Java Objects add the following dependency to your project


Then you can use the stacks-client API:

    StacksClient stacksClient = new StacksClient();
    Stacks stacks = stacksClient.getStacks();

When you get the Stacks the stacks-client will retrieve the Stacks.yaml file from its repository and cache it locally. The cache will be updated once a day (24 hours since last update)

With the stacks object, you can navigate on the stacks graph. For more information take a look at the Stacks format diagram


    // Get The Available Archetypes

    // Get all BOMs from a Runtime 

    //Get the Download URL from the Recommended Runtime from a Major Release (AS7 for example)

    //Get the BOM name of the Default BOM from a Runtime

Advances JBoss Stacks Client configuration

The stacks-client can be configured through the StacksClientConfiguration interface.

You can implement this class and pass it on the constructor of the StacksClient


    MyConfiguration myConfig = new MyConfiguration();
    StacksClient stacksClient = new StacksClient(myConfig);

If no configuration is supplied, StacksClient will use 'DefaultStacksClientConfiguration' class with de following values:

  • url: The URL of stacks yaml file repository.

    You can use JVM jdf.stacks.client.repo System property to set the url repo value. Ex.: java -Djdf.stacks.client.repo

  • proxyHost: Proxy host to use. Default: null

  • proxyPort: Proxy port to use. Default: null
  • proxyUser: Proxy user to use. If proxy uses Authenticantion. Default: null
  • proxyPassword: Proxy password to use. If proxy uses Authenticantion. Default: null

  • online: Flag that indicates if the system should be used online/offline. Default: true

  • cacheRefreshPeriodSeconds: Time in seconds to keep the cache information: Default to 86400 (24 hours)

At any moment will can retrieve the information by calling:


Displaying the Stacks messages on your UI

If you need to get the messages from stacks-client you can provide your own implementation of 'StacksClientMessages' interface and use it on the StacksClient constructor.


    MyConfiguration myConfig = new MyConfiguration();
    MyMessageWay myMsg = new MyMessageWay();
    StacksClient stacksClient = new StacksClient(myConfig, myMsg);