Zandero REST

Zandero REST utilities

License

License

GroupId

GroupId

com.zandero
ArtifactId

ArtifactId

rest
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Zandero REST
Zandero REST utilities
Source Code Management

Source Code Management

https://github.com/Zandero/rest

Download rest

How to add to project

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

Dependencies

compile (10)

Group / Artifact Type Version
com.zandero : utils jar [1.0,)
org.jboss.resteasy : resteasy-jaxrs jar [3.1.1.Final,)
ch.qos.logback : logback-classic jar [1.1.7,)
com.google.inject : guice jar 4.1.0
com.google.inject.extensions : guice-servlet jar 4.1.0
com.google.inject.extensions : guice-multibindings jar 4.1.0
com.fasterxml.jackson.core : jackson-core jar [2.7.3,)
com.fasterxml.jackson.core : jackson-annotations jar [2.7.3,)
com.fasterxml.jackson.core : jackson-databind jar [2.7.3,)
javax.servlet : javax.servlet-api jar [3.1.0,)

test (9)

Group / Artifact Type Version
com.fasterxml.jackson.jaxrs : jackson-jaxrs-json-provider jar [2.7.3,)
org.jboss.resteasy : resteasy-jackson2-provider jar [3.1.1.Final,)
junit : junit jar [4.12,)
net.trajano.commons : commons-testing jar [2.1.0,)
org.mockito : mockito-all jar [1.10.19,)
com.google.inject.extensions : guice-assistedinject jar 4.1.0
org.jboss.resteasy : resteasy-guice jar [3.1.1.Final,)
org.eclipse.jetty : jetty-server jar [9.3.7.v20160115,)
org.eclipse.jetty : jetty-servlet jar [9.3.7.v20160115,)

Project Modules

There are no modules declared in this project.

Events for RestEasy

Sometime we need to do a little bit more when a REST API is called, but in doing so we slow down the REST API itself.
Events for RestEasy is a simple library that enables triggering of custom events when a REST API is called.

Event triggering supports:

  • asynchronous event execution
  • events on specific response codes
  • exception based event triggers
  • exception handling and wrapping to JSON response
  • Guice for dependency injection

Setup

 <dependency>      
      <groupId>com.zandero</groupId>      
      <artifactId>rest.events</artifactId>      
      <version>1.2</version>      
 </dependency>

Example

Simple event triggered on every call to /ping

@GET
@Path("/ping")
@RestEvent(processor = PingEvent.class)
@Produces(MediaType.APPLICATION_JSON)
public String ping() {

    return "ping";
}
public class PingEvent implements RestEventProcessor {
    @Override
    public RestEventResult execute(Serializable entity, RestEventContext context) throws Exception {
        // magic happens here
        return RestEventResult.ok();
    }
}

Additional info

com.zandero

Zandero

A collection of useful utilities, extensions and wrappers

Versions

Version
1.0