Coder Social home page Coder Social logo

common-client's Introduction

Common Client

Dependency Check Maven Central License

This library helps you to easily create other libraries interacting with services using asynchronous requests and returning CompletableFuture. The serialization and deserialization of domain objects are performed using Jackson.

Presently, it supports the following HTTP clients:

Installation

The dependency is available in maven central (see badge for version):

<dependency>
    <groupId>com.chavaillaz</groupId>
    <artifactId>common-client</artifactId>
</dependency>

Usage

  • Create the interfaces corresponding to every API you want to interact with (e.g. UserApi)
    • Make them extend Client to have methods to set proxy and authentication information
    • Always return completable futures, either CompletableFuture<YourDomainType> or CompletableFuture<Void>
  • Create the authentication method for your service (in case it does not already exist) by extending Authentication
    • Presently, there are token and password authentications available
  • Create an implementation of your interfaces by extending the available abstract classes for each HTTP client
  • Create a central client to manage and get other ones by extending AbstractClient

Contributing

If you have a feature request or found a bug, you can:

  • Write an issue
  • Create a pull request

Code style

The code style is based on the default one from IntelliJ, except for the following cases:

Imports

Imports are ordered as follows:

  • All static imports in a block
  • Java non-static imports in a block
  • All non-static imports in a block

A single blank line separates every block. Within each block the imported names appear in alphabetical sort order. Wildcard imports, static or otherwise, are not used.

License

This project is under Apache 2.0 License.

common-client's People

Contributors

chavjoh avatar

Stargazers

 avatar

Watchers

 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.