public abstract class AbstractRestUserClient extends Object implements RestUserClient, FlexibleResourceClient, FlexibleUserClient, ResourceUrlBuilder
| Constructor and Description |
|---|
AbstractRestUserClient(RestServiceClient restServiceClient) |
AbstractRestUserClient(RestServiceClient restServiceClient,
UserCredential userCredential) |
AbstractRestUserClient(String resourceBaseUrl) |
AbstractRestUserClient(String resourceBaseUrl,
UserCredential userCredential) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
delete(String id,
Map<String,Object> params)
Both id and params cannot be null.
|
Map<String,Object> |
get(String id,
Map<String,Object> params)
Both id and params cannot be null.
|
AuthRefreshPolicy |
getAuthRefreshPolicy() |
AutoRedirectPolicy |
getAutoRedirectPolicy() |
CacheControlPolicy |
getCacheControlPolicy() |
ClientCachePolicy |
getClientCachePolicy() |
protected FlexibleResourceClient |
getFlexibleRestServiceClient() |
RequestRetryPolicy |
getRequestRetryPolicy() |
String |
getResourceBaseUrl()
Return the ResourceBaseUrl of this "resource".
|
String |
getResourceDeleteUrl(String id,
Map<String,Object> params)
Both id and params cannot be null.
|
String |
getResourceGetUrl(String id,
Map<String,Object> params)
Both id and params cannot be null.
|
String |
getResourcePatchUrl(String id)
Returns the URL for PUT'ing to the resource specified by the id.
|
String |
getResourcePostUrl()
Returns the URL for POST'ing to the resource.
|
String |
getResourcePutUrl(String id)
Returns the URL for PUT'ing to the resource specified by the id.
|
protected RestServiceClient |
getRestServiceClient() |
UserCredential |
getUserCredential()
Returns the UserCredential associated with this UserClient.
|
protected void |
init() |
boolean |
isAccessAllowed() |
boolean |
isMethodSupported(String methodName) |
protected RestUserClientMaker |
makeRestUserClientMaker() |
protected RestServiceClient |
makeServiceClient(String resourceBaseUrl) |
Map<String,Object> |
patch(Object partialData,
String id) |
Map<String,Object> |
post(Object inputData)
Returns the new resource created by the given input.
|
Map<String,Object> |
put(Object inputData,
String id)
Returns the resource created/updated by the given input.
|
void |
setAuthRefreshPolicy(AuthRefreshPolicy authRefreshPolicy) |
void |
setAutoRedirectPolicy(AutoRedirectPolicy autoRedirectPolicy) |
void |
setCacheControlPolicy(CacheControlPolicy cacheControlPolicy) |
void |
setClientCachePolicy(ClientCachePolicy clientCachePolicy) |
void |
setRequestRetryPolicy(RequestRetryPolicy requestRetryPolicy) |
void |
setUserCredential(UserCredential userCredential) |
String |
toString() |
public AbstractRestUserClient(String resourceBaseUrl)
public AbstractRestUserClient(String resourceBaseUrl, UserCredential userCredential)
public AbstractRestUserClient(RestServiceClient restServiceClient)
public AbstractRestUserClient(RestServiceClient restServiceClient, UserCredential userCredential)
protected void init()
protected RestServiceClient getRestServiceClient()
protected FlexibleResourceClient getFlexibleRestServiceClient()
protected RestUserClientMaker makeRestUserClientMaker()
protected RestServiceClient makeServiceClient(String resourceBaseUrl)
public boolean isMethodSupported(String methodName)
isMethodSupported in interface MethodFilterpublic String getResourceBaseUrl()
ResourceClientgetResourceBaseUrl in interface ResourceUrlBuildergetResourceBaseUrl in interface ResourceClientpublic String getResourceGetUrl(String id, Map<String,Object> params)
ResourceUrlBuildergetResourceGetUrl in interface ResourceUrlBuilderid - Resource id.params - URL query parameters to select a collection.public String getResourcePostUrl()
ResourceUrlBuildergetResourcePostUrl in interface ResourceUrlBuilderpublic String getResourcePutUrl(String id)
ResourceUrlBuildergetResourcePutUrl in interface ResourceUrlBuilderid - Resource id.public String getResourcePatchUrl(String id)
ResourceUrlBuildergetResourcePatchUrl in interface ResourceUrlBuilderid - Resource id.public String getResourceDeleteUrl(String id, Map<String,Object> params)
ResourceUrlBuildergetResourceDeleteUrl in interface ResourceUrlBuilderid - Resource id.params - URL query parameters to select a collection.public AuthRefreshPolicy getAuthRefreshPolicy()
getAuthRefreshPolicy in interface WebClientpublic void setAuthRefreshPolicy(AuthRefreshPolicy authRefreshPolicy)
setAuthRefreshPolicy in interface FlexibleWebClientpublic RequestRetryPolicy getRequestRetryPolicy()
getRequestRetryPolicy in interface WebClientpublic void setRequestRetryPolicy(RequestRetryPolicy requestRetryPolicy)
setRequestRetryPolicy in interface FlexibleWebClientpublic ClientCachePolicy getClientCachePolicy()
getClientCachePolicy in interface WebClientpublic void setClientCachePolicy(ClientCachePolicy clientCachePolicy)
setClientCachePolicy in interface FlexibleWebClientpublic CacheControlPolicy getCacheControlPolicy()
getCacheControlPolicy in interface WebClientpublic void setCacheControlPolicy(CacheControlPolicy cacheControlPolicy)
setCacheControlPolicy in interface FlexibleWebClientpublic AutoRedirectPolicy getAutoRedirectPolicy()
getAutoRedirectPolicy in interface WebClientpublic void setAutoRedirectPolicy(AutoRedirectPolicy autoRedirectPolicy)
setAutoRedirectPolicy in interface FlexibleWebClientpublic UserCredential getUserCredential()
UserClientgetUserCredential in interface UserClientpublic void setUserCredential(UserCredential userCredential)
setUserCredential in interface FlexibleUserClientpublic boolean isAccessAllowed()
public Map<String,Object> get(String id, Map<String,Object> params) throws IOException
RestUserClientget in interface RestUserClientid - Resource id.params - URL query parameters to select a collection.IOException - TODOpublic Map<String,Object> post(Object inputData) throws IOException
RestUserClientpost in interface RestUserClientinputData - The object to be created.IOException - TODOpublic Map<String,Object> put(Object inputData, String id) throws IOException
RestUserClientput in interface RestUserClientinputData - The new resource.id - Resource id.IOException - TODOpublic Map<String,Object> patch(Object partialData, String id) throws IOException
patch in interface RestUserClientIOExceptionpublic Map<String,Object> delete(String id, Map<String,Object> params) throws IOException
RestUserClientdelete in interface RestUserClientid - Resource id.params - URL query parameters to select a collection.IOException - TODOCopyright © 2013. All rights reserved.