Book Detail : RESTful Java with JAX-RS 2.0, 2nd Edition

Book Title: 
RESTful Java with JAX-RS 2.0, 2nd Edition
Resource Category: 
Author: 
Publisher: 
Publication Year: 
2 013
Number of Pages: 
392
ISBN: 
978-1-44936-134-1
Language: 
English
Edition: 
Second
WishList: 
yes
Available at Shelf: 
No
Description: 

Learn how to design and develop distributed web services in Java, using RESTful architectural principles and the JAX-RS 2.0 specification in JavaEE 7. By focusing on implementation rather than theory, this hands-on reference demonstrates how easy it is to get started with services based on the REST architecture.

With the book's technical guide, you'll learn how REST and JAX-RS work and when to use them. The RESTEasy workbook that follows provides step-by-step instructions for installing, configuring, and running several working JAX-RS examples, using the JBoss RESTEasy implementation of JAX-RS 2.0.

Table of Contents (Summary): 

Part I. REST and the JAX-RS Standard

1.Introduction to REST

2.Designing RESTful Services

3.Your First JAX-RS Service

4.HTTP Method and URI Matching

5.JAX-RS Injection

6.JAX-RS Content Handlers

7.Server Responses and Exception Handling

8.JAX-RS Client API

9.HTTP Content Negotiation

10.HATEOAS

11.Scaling JAX-RS Applications

12.Filters and Interceptors

13.Asynchronous JAX-RS

14.Deployment and Integration

15.Securing JAX-RS

16.Alternative Java Clients

Part II. JAX-RS Workbook

17.Workbook Introduction

18.Examples for Chapter 3

19.Examples for Chapter 4

20.Examples for Chapter 5

21.Examples for Chapter 6

22.Examples for Chapter 7

23.Examples for Chapter 9

24.Examples for Chapter 10

25.Examples for Chapter 11

26.Examples for Chapter 12

27.Examples for Chapter 13

28.Examples for Chapter 14

29.Examples for Chapter 15

Index

Table of Contents (Expanded): 

Part I. REST and the JAX-RS Standard

1. Introduction to REST

  • REST and the Rebirth of HTTP
  • RESTful Architectural Principles
    • Addressability
    • The Uniform, Constrained Interface
    • Why Is the Uniform Interface Important?
    • Representation-Oriented
    • Communicate Statelessly
    • HATEOAS 
  • Wrapping Up

2. Designing RESTful Services

  • The Object Model
  • Model the URIs
  • Defining the Data Format
    • Read and Update Format
    • Create Format
  • Assigning HTTP Methods
    • Browsing All Orders, Customers, or Products
    • Obtaining Individual Orders, Customers, or Products
    • Creating an Order, Customer, or Product
    • Updating an Order, Customer, or Product
    • Removing an Order, Customer, or Product
    • Cancelling an Order
  • Wrapping Up

3. Your First JAX-RS Service

  • Developing a JAX-RS RESTful Service
    • Customer: The Data Class
    • CustomerResource: Our JAX-RS Service
    • JAX-RS and Java Interfaces
    • Inheritance
  • Deploying Our Service
  • Writing a Client
  • Wrapping Up

4. HTTP Method and URI Matching

  • Binding HTTP Methods
    • HTTP Method Extension
  • @Path
    • Binding URIs
    • @Path Expressions
    • Matrix Parameters
  • Subresource Locators
    • Full Dynamic Dispatching
  • Gotchas in Request Matching
  • Wrapping Up

5. JAX-RS Injection

  • The Basics
  • @PathParam
    • More Than One Path Parameter
    • Scope of Path Parameters
    • PathSegment and Matrix Parameters
    • Programmatic URI Information
  • @MatrixParam
  • @QueryParam
    • Programmatic Query Parameter Information
  • @FormParam
  • @HeaderParam
    • Raw Headers
  • @CookieParam
  • @BeanParam
  • Common Functionality
    • Automatic Java Type Conversion
    • @DefaultValue
    • @Encoded
  • Wrapping Up

6. JAX-RS Content Handlers

  • Built-in Content Marshalling
    • javax.ws.rs.core.StreamingOutput
    • java.io.InputStream, java.io.Reader
    • java.io.File
    • byte[]
    • String, char[]
    • MultivaluedMap and Form Input
    • javax.xml.transform.Source
  • JAXB
    • Intro to JAXB
    • JAXB JAX-RS Handlers
    • JAXB and JSON
    • JSON and JSON Schema
  • Custom Marshalling
    • MessageBodyWriter
    • MessageBodyReader
    • Life Cycle and Environment
  • Wrapping Up

7. Server Responses and Exception Handling

  • Default Response Codes
    • Successful Responses
    • Error Responses
  • Complex Responses
    • Returning Cookies
    • The Status Enum
    • javax.ws.rs.core.GenericEntity
  • Exception Handling
    • javax.ws.rs.WebApplicationException
    • Exception Mapping
    • Exception Hierarchy
  • Wrapping Up

8. JAX-RS Client API

  • Client Introduction
  • Bootstrapping with ClientBuilder
  • Client and WebTarget
  • Building and Invoking Requests
    • Invocation
    • Exception Handling
  • Configuration Scopes
  • Wrapping Up

9. HTTP Content Negotiation

  • Conneg Explained
    • Preference Ordering
  • Language Negotiation
  • Encoding Negotiation
  • JAX-RS and Conneg
    • Method Dispatching
    • Leveraging Conneg with JAXB
    • Complex Negotiation
    • Negotiation by URI Patterns
  • Leveraging Content Negotiation
    • Creating New Media Types
    • Flexible Schemas
  • Wrapping Up

10. HATEOAS

  • HATEOAS and Web Services
    • Atom Links
    • Advantages of Using HATEOAS with Web Services
    • Link Headers Versus Atom Links
  • HATEOAS and JAX-RS
    • Building URIs with UriBuilder
    • Relative URIs with UriInfo
  • Building Links and Link Headers
    • Writing Link Headers
    • Embedding Links in XML
  • Wrapping Up

11. Scaling JAX-RS Applications

  • Caching
    • HTTP Caching
    • Expires Header
    • Cache-Control
    • Revalidation and Conditional GETs
  • Concurrency
    • JAX-RS and Conditional Updates
  • Wrapping Up

12. Filters and Interceptors

  • Server-Side Filters
    • Server Request Filters
    • Server Response Filters
  • Reader and Writer Interceptors
  • Client-Side Filters
  • Deploying Filters and Interceptors
  • Ordering Filters and Interceptors
  • Per-JAX-RS Method Bindings
    • DynamicFeature
    • Name Bindings
    • DynamicFeature Versus @NameBinding
  • Exception Processing
  • Wrapping Up

13. Asynchronous JAX-RS

  • AsyncInvoker Client API
    • Using Futures
    • Using Callbacks
    • Futures Versus Callbacks
  • Server Asynchronous Response Processing
    • AsyncResponse API
    • Exception Handling
    • Cancel
    • Status Methods
    • Timeouts
    • Callbacks
    • Use Cases for AsyncResponse
  • Wrapping Up

14. Deployment and Integration

  • Deployment
    • The Application Class
    • Deployment Within a JAX-RS-Aware Container
    • Deployment Within a JAX-RS-Unaware Container
  • Configuration
    • Basic Configuration
  • EJB Integration
  • Spring Integration
  • Wrapping Up

15. Securing JAX-RS

  • Authentication
    • Basic Authentication
    • Digest Authentication
    • Client Certificate Authentication
  • Authorization
  • Authentication and Authorization in JAX-RS
    • Enforcing Encryption
    • Authorization Annotations
  • Programmatic Security
  • Client Security
    • Verifying the Server
  • OAuth 2.0
  • Signing and Encrypting Message Bodies
    • Digital Signatures
    • Encrypting Representations
  • Wrapping Up

16. Alternative Java Clients

  • java.net.URL
    • Caching
    • Authentication
    • Advantages and Disadvantages
  • Apache HttpClien
    • Authentication
    • Advantages and Disadvantages
  • RESTEasy Client Proxies
    • Advantages and Disadvantages
  • Wrapping Up

Part II. JAX-RS Workbook

17. Workbook Introduction

  • Installing RESTEasy and the Examples
  • Example Requirements and Structure
    • Code Directory Structure
    • Environment Setup

18. Examples for Chapter 3

  • Build and Run the Example Program
    • Deconstructing pom.xml
    • Running the Build
  • Examining the Source Code

19. Examples for Chapter 4

  • Example ex04_1: HTTP Method Extension
    • Build and Run the Example Program
    • The Server Code
    • The Client Code
  • Example ex04_2: @Path with Expressions
    • Build and Run the Example Program
    • The Server Code
    • The Client Code
  • Example ex04_3: Subresource Locators
    • Build and Run the Example Program
    • The Server Code
    • The Client Code

20. Examples for Chapter 5

  • Example ex05_1: Injecting URI Information
    • The Server Code
    • The Client Code
    • Build and Run the Example Program
  • Example ex05_2: Forms and Cookies
    • The Server Code
    • Build and Run the Example Program

21. Examples for Chapter 6

  • Example ex06_1: Using JAXB
    • The Client Code
    • Changes to pom.xml
    • Build and Run the Example Program
  • Example ex06_2: Creating a Content Handler
    • The Content Handler Code
    • The Resource Class
    • The Application Class
    • The Client Code
    • Build and Run the Example Program

22. Examples for Chapter 7

  • Example ex07_1: ExceptionMapper
    • The Client Code
    • Build and Run the Example Program

23. Examples for Chapter 9

  • Example ex09_1: Conneg with JAX-RS
    • The Client Code
    • Build and Run the Example Program
  • Example ex09_2: Conneg via URL Patterns
    • The Server Code
    • Build and Run the Example Program

24. Examples for Chapter 10

  • Example ex10_1: Atom Links
    • The Server Code
    • The Client Code
    • Build and Run the Example Program
  • Example ex10_2: Link Headers
    • The Server Code
    • The Client Code
    • Build and Run the Example Program

25. Examples for Chapter 11

  • Example ex11_1: Caching and Concurrent Updates
    • The Server Code
    • The Client Code
    • Build and Run the Example Program

26. Examples for Chapter 12

  • Example ex12_1 : ContainerResponseFilter and DynamicFeature
    • The Server Code
    • The Client Code
    • Build and Run the Example Program
  • Example ex12_2: Implementing a WriterInterceptor
    • The Client Code
    • Build and Run the Example Program

27. Examples for Chapter 13

  • Example ex13_1: Chat REST Interface
    • The Client Code
    • The Server Code
    • Build and Run the Example Program

28. Examples for Chapter 14

  • Example ex14_1: EJB and JAX-RS
    • Project Structure
    • The EJBs
    • The Remaining Server Code
    • The Client Code
    • Build and Run the Example Program
  • Example ex14_2: Spring and JAX-RS
    • Build and Run the Example Program

29. Examples for Chapter 15

  • Example ex15_1: Custom Security
    • One-Time Password Authentication
    • Allowed-per-Day Access Policy
    • Build and Run the Example Program
  • Example ex15_1: JSON Web Encryption
    • Build and Run the Example Program

Index

Tags: 
2.992425
Average: 3 (66 votes)

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!