JBoss Stacks Client

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);

Share the Knowledge

Find this guide useful?


Find a bug in the guide? Something missing? You can fix it by [forking the repository](http://github.com/jboss-jdf/stacks-client), making the correction and [sending a pull request](http://help.github.com/send-pull-requests). If you're just plain stuck, feel free to ask a question in the [user discussion forum](http://site-jdf.rhcloud.com/forums/jdf-users).

Recent Changelog

  • Nov 13, 2012: Prepare for 1.0.1.final release Rafael Benevides
  • Nov 06, 2012: Added release scripts Rafael Benevides
  • Oct 10, 2012: Prepare for 1.0.1-snapshot development Rafael Benevides
  • Oct 10, 2012: Update the readme to 1.0.0.final Rafael Benevides
  • Sep 04, 2012: Prepared for cr1 format, improved test, and url repo config Rafael Benevides
  • Aug 31, 2012: Jboss stacks client initial commit Rafael Benevides
  • Aug 31, 2012: Initial commit Rafael Benevides

See full history »