GithubHelp home page GithubHelp logo

adoptopenjdk / openjdk-api-java-client Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 782 KB

A Java wrapper around the AdoptOpenJDK REST API

License: Apache License 2.0

Java 99.00% HTML 1.00%
adoptopenjdk-api adoptopenjdk-java java openjdk

openjdk-api-java-client's Introduction

openjdk-api-java-client

Maven Central Maven Central (snapshot) Codecov

A Java client for the AdoptOpenJDK REST API.

adoptopenjdk

JVM Platform Status
OpenJDK LTS Linux Build (OpenJDK LTS, Linux)
OpenJDK Current Linux Build (OpenJDK Current, Linux)
OpenJDK Current Windows Build (OpenJDK Current, Windows)

Features

  • Efficient, type-safe access to the AdoptOpenJDK API
  • Clean API/implementation separation for easy API mocking in applications
  • JPMS-ready
  • OSGi-ready
  • High coverage automated test suite
  • Apache 2.0 license
  • Fully documented (JavaDOC)

Usage

Use the following Maven dependencies:

<dependency>
  <groupId>net.adoptopenjdk</groupId>
  <artifactId>net.adoptopenjdk.v3.api</artifactId>
  <version><!-- Insert latest version --></version>
</dependency>
<dependency>
  <groupId>net.adoptopenjdk</groupId>
  <artifactId>net.adoptopenjdk.v3.vanilla</artifactId>
  <version><!-- Insert latest version --></version>
</dependency>

The first dependency specifies that you want to use the API, and the second is a basic provider for the API.

Then:

var clients = new AOV3Clients();
try (var client = clients.createClient()) {
  var request = client.availableReleases(...);
  var releases = request.execute();
}

The API operates entirely synchronously and raises checked exceptions on failures.

The net.adoptopenjdk.v3.api.AOV3ClientProviderType interface is published both as a JPMS service and an OSGi service in order to allow for decoupling consumers from the vanilla implementation package:

var clients =
  ServiceLoader.load(AOV3ClientProviderType.class)
    .findFirst()
    .orElseThrow(() -> new IllegalStateException(
      String.format("No implementations of %s are available", AOV3ClientProviderType.class)));

try (var client = clients.createClient()) {
  var request = client.availableReleases(...);
  var releases = request.execute();
}

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.