Table of Contents

Glassfish Debugging, Caching, HATEOAS, RESTEasy

Glassfish application debugging

See how to debug an app on Glassfish: Glassfish Application Debug IntelliJ Tutorial

RESTEasy

Another JAX-RS implementation except Jersey JBoss: http://www.jboss.org/resteasy

Uses the same API and package javax.ws.rs.*

Simple dependencies with JSON for Maven:

<dependencies>
	<dependency>
		<groupId>org.jboss.resteasy</groupId>
		<artifactId>resteasy-jaxrs</artifactId>
		<version>2.2.1.GA</version>
	</dependency>

	<dependency>
		<groupId>org.jboss.resteasy</groupId>
		<artifactId>resteasy-jackson-provider</artifactId>
		<version>2.2.1.GA</version>
	</dependency>
</dependencies>

<repositories>
	<repository>
		<id>JBOSS_NEXUS</id>
		<url>http://repository.jboss.org/nexus/content/groups/public</url>
	</repository>
</repositories>

REST architecture constraints

Talk on the topic given by doc. Ing. Tomáš Vitvar, Ph.D (FIT): HATEOAS-Vitvar

Caching

HTTP Headers Cache-Control, Last-Modified, ETag, If-Modified-Since, If-None-Match

Cache-Control

Defines caching setting for client, proxy

Last-Modified

Response header, defines when the resource was last modified.

If-Modified-Since

Request header, defines that the resource returns ok (200), if modified since the given date, 304 otherwise.

ETag

Response header, defines the tag (hash) of the returned resource.

If-None-Match

Request header, defines, that the resource should be returned if the tag was modified, otherwise returns 304

Example

caching.zip

Concurrency Control

Lze možné tyto caching headers použít i pro Concurrency Control?

If-Unmodified-Since

Request header (for Last-Modified response header) - if holds, 200 / 204, otherwise 412 Precondition Failed

If-Match

Request header (for ETag response header) - if holds, 200 / 204, otherwise 412 Precondition Failed

HATEOAS

Hypertext as the Engine for Application State

HATEOAS - using links and headers we can store the state of the application.

Stateless ordering system design

Download the RESTEasy project: HATEOAS

Resources: