Git Product home page Git Product logo

atlassian-restclient-jiracloud's Introduction

atlassian-restclient-jiracloud

Asynchronous REST client for Jira Cloud written in Java.

Introduction

The goal of this library to have an asynchronous, typesafe and independent library for Atlassian Jira Cloud.

Usage

// Create a HTTPClient instance (currently Jetty Client is supported
// as it is non-blocking
HttpClient httpClient = ...

// Create a Rest Client instance. This instance will have the right
// ObjectMapper inside, so conversion of date-times should be OK.
RestClient restClient =
    JiraCloudRestClientFactory.createRestClient(httpClient);

// Create a reusable API instance. E.g.:
VersionApi versionApi = new VersionApi(restClient);

// If needed, create a RestRequstEnhancer. Such enhancer can be
// used to attach an act-as-user or a call-as-addon token to the
// request, or replace the basePath to the URL of the Jira Cloud
// instance of the client.
RestRequestEnhancer enhancer = ...

// Call any function on the created API
Single<Version> versionSingle = versionApi.getVersion(id,
    Optional.empty(), Optional.of(enhancer));

// Use the functions of RXJava Single to receive the version synchronously
// or asynchronously. E.g.:
single.subscribe(version -> {...}, error -> {...});

Handling errors

In case of the response arrives back, but the status is >= 400, a RestException is passed to the error handler of Single. RestException contains the status and the body of the response as String if available.

See also

  • Documentation of Everit HTTP Client library
  • Additional libraries that help creating RestRequestEnhancers for the different Jira Clients having basePath modification, act-as-user or call-as-addon authentication tokens. (coming soon)

atlassian-restclient-jiracloud's People

Contributors

attila-kiss-it avatar balazs-zsoldos avatar dependabot[bot] avatar borvizrobi avatar gyongyi-kiss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.