public class BookingService extends Object
Modifier and Type | Field and Description |
---|---|
private Credentials |
credentials |
private Transport |
transport |
private URL |
url |
Constructor and Description |
---|
BookingService() |
BookingService(URL url,
Credentials credentials,
Transport transport)
Constructs the service.
|
Modifier and Type | Method and Description |
---|---|
long |
create(BookingInfo bookingInfo)
Create booking on the server.
|
void |
delete(int version,
long id)
Deletes a booking.
|
BookingInfo |
get(long id)
Returns an entity.
|
List<BookingInfo> |
list()
Returns list of bookings.
|
void |
put(int version,
BookingInfo bookingInfo,
long id)
Modifies a booking.
|
private URL url
private Credentials credentials
private Transport transport
public BookingService()
public BookingService(URL url, Credentials credentials, Transport transport)
url
- of the servercredentials
- to work with the servertransport
- to know the method to reach the serverpublic void put(int version, BookingInfo bookingInfo, long id)
version
- expected latest version of sellerbookingInfo
- data to putVersionConflictJsonException
- if version mismatchNotFoundJsonException
- if booking or seller wasn't foundForbiddenJsonException
- if user hasn't access to this bookingpublic void delete(int version, long id)
version
- current version of the entityid
- identifies entityVersionConflictJsonException
- if version mismatchNotFoundJsonException
- if booking or seller wasn't foundForbiddenJsonException
- if user hasn't access to this bookingpublic long create(BookingInfo bookingInfo)
bookingInfo
- data to putNotFoundJsonException
- if seller wasn't foundpublic BookingInfo get(long id)
id
- identifies entityNotFoundJsonException
- if booking or seller wasn't foundForbiddenJsonException
- if user hasn't access to this bookingpublic List<BookingInfo> list()
Copyright © 2015. All rights reserved.