public class RestaurantService extends Object
Modifier and Type | Field and Description |
---|---|
private Credentials |
credentials |
private Transport |
transport |
private URL |
url |
Constructor and Description |
---|
RestaurantService(URL url,
Credentials credentials,
Transport transport)
Constructs the service.
|
Modifier and Type | Method and Description |
---|---|
RestaurantOverviewInfo |
get(String sellerId,
Integer version)
Get latest information about seller from the server.
|
List<RestaurantListInfo> |
list()
Returns list of entities.
|
List<RestaurantListInfo> |
list(Integer firstResult,
Integer maxResults,
String like,
PublicSellerInfo.Fields orderBy,
Boolean orderDesc)
Returns list of entities.
|
void |
put(int version,
String sellerId,
RestaurantInfo restaurantInfo)
Send information about restaurant to the server to store it.
|
void |
remove(String sellerId)
Remove seller and all information that concerns seller.
|
private URL url
private Credentials credentials
private Transport transport
public RestaurantService(URL url, Credentials credentials, Transport transport)
url
- of the servercredentials
- to work with the servertransport
- to know the method to reach the serverpublic RestaurantOverviewInfo get(String sellerId, Integer version)
sellerId
- of the sellerversion
- put value from SellerService.getThisVersion()
. if you don't have any SellerInfo
instance, then pass null to return the data anywaySellerServiceSample
public void put(int version, String sellerId, RestaurantInfo restaurantInfo)
restaurantInfo
- the datasellerId
- seller-restaurant idVersionConflictJsonException
- if server has newer data sent from other client beforeSellerServiceSample
public void remove(String sellerId)
sellerId
- identifier of sellerpublic List<RestaurantListInfo> list()
ForbiddenJsonException
- see:
ForbiddenErrorType.INSUFFICIENT_ACCESS_RIGHTS
public List<RestaurantListInfo> list(Integer firstResult, Integer maxResults, String like, PublicSellerInfo.Fields orderBy, Boolean orderDesc)
firstResult
- when pagination starts or nullmaxResults
- amount of items per page or nulllike
- search string filter or nullorderBy
- field to order by, possible values are "identifier", "name", "vat"orderDesc
- field to direction of orderingForbiddenJsonException
- see:
ForbiddenErrorType.INSUFFICIENT_ACCESS_RIGHTS
Copyright © 2018. All rights reserved.