public abstract class AbstractBoxResourceManager extends Object implements IBoxResourceManager
| Constructor and Description |
|---|
AbstractBoxResourceManager(IBoxConfig config,
IBoxResourceHub resourceHub,
IBoxJSONParser parser,
IBoxRequestAuth auth,
IBoxRESTClient restClient)
private constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
executeRequestWithNoResponseBody(DefaultBoxRequest request)
Execute a request and expect no response body.
|
IBoxRequestAuth |
getAuth() |
protected Class |
getClassFromType(IBoxType type) |
IBoxConfig |
getConfig() |
IBoxJSONParser |
getJSONParser() |
IBoxResourceHub |
getResourceHub() |
Object |
getResponseAndParse(DefaultBoxRequest request,
IBoxType type,
IBoxJSONParser parser)
Make a rest api request, get response, and then parse the response.
|
Object |
getResponseAndParseAndTryCast(DefaultBoxRequest request,
IBoxType type,
IBoxJSONParser parser)
Make a rest api request, get response, parse the response, and try to cast parsed out object into expected object.
|
protected IBoxRESTClient |
getRestClient() |
protected Object |
tryCastBoxItem(BoxResourceType type,
Object item)
Try to cast a box item into a concrete class(i.e.
|
Object |
tryCastObject(IBoxType expectedType,
Object obj)
Try to cast an object into a specific class.
|
public AbstractBoxResourceManager(IBoxConfig config, IBoxResourceHub resourceHub, IBoxJSONParser parser, IBoxRequestAuth auth, IBoxRESTClient restClient)
config - ConfigresourceHub - IResourceHubparser - json parserauth - auth for api callsrestClient - REST client to make api calls.public IBoxRequestAuth getAuth()
protected IBoxRESTClient getRestClient()
public IBoxResourceHub getResourceHub()
public IBoxJSONParser getJSONParser()
public IBoxConfig getConfig()
protected void executeRequestWithNoResponseBody(DefaultBoxRequest request) throws BoxServerException, BoxRestException, AuthFatalFailureException
public Object getResponseAndParseAndTryCast(DefaultBoxRequest request, IBoxType type, IBoxJSONParser parser) throws BoxRestException, AuthFatalFailureException, BoxServerException
public Object getResponseAndParse(DefaultBoxRequest request, IBoxType type, IBoxJSONParser parser) throws BoxRestException, AuthFatalFailureException
public Object tryCastObject(IBoxType expectedType, Object obj) throws BoxServerException, BoxRestException
BoxServerExceptionBoxRestExceptionprotected Object tryCastBoxItem(BoxResourceType type, Object item) throws BoxServerException, BoxRestException
BoxServerExceptionBoxRestExceptionCopyright © 2014. All Rights Reserved.