RPC-like httpCall-to-javaMethod mapper module for jus

Communication library for Android and Java

License

License

GroupId

GroupId

io.apptik.comm
ArtifactId

ArtifactId

retro-jus
Last Version

Last Version

0.6.9
Release Date

Release Date

Type

Type

jar
Description

Description

RPC-like httpCall-to-javaMethod mapper module for jus
Communication library for Android and Java
Project URL

Project URL

https://github.com/apptik/jus/tree/master/retro-jus
Source Code Management

Source Code Management

https://github.com/apptik/jus/tree/master/retro-jus

Download retro-jus

How to add to project

<!-- https://jarcasting.com/artifacts/io.apptik.comm/retro-jus/ -->
<dependency>
    <groupId>io.apptik.comm</groupId>
    <artifactId>retro-jus</artifactId>
    <version>0.6.9</version>
</dependency>
// https://jarcasting.com/artifacts/io.apptik.comm/retro-jus/
implementation 'io.apptik.comm:retro-jus:0.6.9'
// https://jarcasting.com/artifacts/io.apptik.comm/retro-jus/
implementation ("io.apptik.comm:retro-jus:0.6.9")
'io.apptik.comm:retro-jus:jar:0.6.9'
<dependency org="io.apptik.comm" name="retro-jus" rev="0.6.9">
  <artifact name="retro-jus" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.apptik.comm', module='retro-jus', version='0.6.9')
)
libraryDependencies += "io.apptik.comm" % "retro-jus" % "0.6.9"
[io.apptik.comm/retro-jus "0.6.9"]

Dependencies

compile (1)

Group / Artifact Type Version
io.apptik.comm : jus-java jar 0.6.9

test (4)

Group / Artifact Type Version
junit : junit jar [4,)
org.assertj : assertj-core jar 2.6.0
org.mockito : mockito-core jar 2.5.0
com.squareup.okhttp : mockwebserver jar 2.7.5

Project Modules

There are no modules declared in this project.

jus

JavaDocs

Build Status Join the chat at https://gitter.im/apptik/jus StackExchange Stories in Ready

Jus is a flexible and easy HTTP/REST client library for Java and Android.

  • it is like Volley but much easier
  • it is like Retrofit but infinitely more flexible

Jus is inspired by the flexibility, modularity and transparency of Google's Volley Library and the extreme simplicity of declarative API mapping of Retrofit.

Like Volley the main thing where Requests are executed is the RequestQueue.

RequestQueue queue = Jus.newRequestQueue();

and then Requests can be added to the Queue:

queue.add(new Request<String>(
                        Request.Method.GET,
                        HttpUrl.parse(BeerService.fullUrl),
                        new Converters.StringResponseConverter())
                        .addResponseListener((r) -> out.println("RESPONSE: " + r))
                        .addErrorListener((e) -> out.println("ERROR: " + e))
        );

Anther option similarly to Retrofit is to map Java Interface to an API.

public interface BeerService {
    @GET("locquery/{user}/{q}")
    Request<String> getBeer(
            @Path("user") String user,
            @Path("q") String q);
}

Then create the Service Instance:

RetroProxy retroJus = new RetroProxy.Builder()
            .baseUrl(BeerService.baseUrl)
            .requestQueue(queue)
            .addConverterFactory(new BasicConverterFactory())
            .build();

    BeerService beerService = retroJus.create(BeerService.class);

And execute a request:

beerService.getBeer(BeerService.userString, "777")
                .addResponseListener((r) -> out.println("RESPONSE: " + r))
                .addErrorListener((e) -> out.println("ERROR: " + e.networkResponse));

Download

Find the latest JARs or grab via Maven:

<dependency>
  <groupId>io.apptik.comm</groupId>
  <artifactId>jus-XXX</artifactId>
  <version>0.6.9</version>
</dependency>

or Gradle:

compile 'io.apptik.comm:jus-XXX:0.6.9'

Downloads of the released versions are available in Sonatype's releases repository.

Snapshots of the development versions are available in Sonatype's snapshots repository.

Jus requires at minimum Java 7 or Android SDK 15.

Examples

Questions

StackOverflow with tag 'jus' or 'apptik'

Modules

  • jus for Java - main jus library for java Maven Central VersionEye

  • Reactive jus - RxJava support for jus Maven Central VersionEye

  • HTTP Stacks

    • OkHttp = OkHttp Client Stack for jus Maven Central VersionEye
    • OkHttp3 = OkHttp3 Client Stack for jus Maven Central VersionEye
    • ApacheHttp = ApacheHttp Client Stack for jus Maven Central VersionEye
    • Netty = Netty Client Stack for jus Maven Central VersionEye
  • Jus for Android

  • Data serializers support and custom requests for jus

Licence

Copyright (C) 2016 AppTik Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
io.apptik.comm

AppTik

app toolkit (architecture, development, test, deployment, monitoring)

Versions

Version
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0a
0.6.0
0.6.0beta