org.exoplatform.services.ws.rest.samples
Class JsonBookService

java.lang.Object
  extended by org.exoplatform.services.ws.rest.samples.JsonBookService
All Implemented Interfaces:
ResourceContainer

public class JsonBookService
extends java.lang.Object
implements ResourceContainer

Simple service for REST demo.

Version:
$Id: $
Author:
Andrey Parfonov

Constructor Summary
JsonBookService(BookStorage books)
          Constructs new instance of JsonBookService.
 
Method Summary
 Response get(java.lang.String key)
          Return request with JSON body which represent Book object.
 Response post(java.lang.String key, java.lang.String baseURI, Book book)
          Create new Book in BookStorage with specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonBookService

public JsonBookService(BookStorage books)
Constructs new instance of JsonBookService.

Parameters:
books - BookStorage.
Method Detail

get

public Response get(java.lang.String key)
Return request with JSON body which represent Book object.

Parameters:
key - the key.
Returns:
@see Response .

post

public Response post(java.lang.String key,
                     java.lang.String baseURI,
                     Book book)
Create new Book in BookStorage with specified key.

Parameters:
key - the key.
baseURI - the base URL.
book - Book.
Returns:
response with status 201, @see Response .


Copyright © 2010 eXo Platform SAS. All Rights Reserved.