public abstract class BoxResourceManager extends Object
| Constructor and Description |
|---|
BoxResourceManager(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()
Get auth.
|
protected Class |
getClassFromType(IBoxType type) |
IBoxConfig |
getConfig()
Get config.
|
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 BoxResourceManager(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
request - requestBoxServerException - excepitonBoxRestException - exceptionAuthFatalFailureException - exception indicating authenticating totally failedpublic Object getResponseAndParseAndTryCast(DefaultBoxRequest request, IBoxType type, IBoxJSONParser parser) throws BoxRestException, AuthFatalFailureException, BoxServerException
request - requesttype - typeparser - json parserAuthFatalFailureException - exceptionBoxRestException - exceptionBoxServerException - exceptionpublic Object getResponseAndParse(DefaultBoxRequest request, IBoxType type, IBoxJSONParser parser) throws BoxRestException, AuthFatalFailureException
request - requesttype - typeparser - ObjectMapperBoxRestException - exceptionAuthFatalFailureException - exception indicating authenticating totally failedpublic Object tryCastObject(IBoxType expectedType, Object obj) throws BoxServerException, BoxRestException
expectedType - expected resource type classobj - objectBoxServerException - exceptionBoxRestException - exceptionprotected Object tryCastBoxItem(BoxResourceType type, Object item) throws BoxServerException, BoxRestException
isFolder - whether it's folderitem - the box item.BoxServerException - exceptionBoxRestException - exceptionCopyright © 2014. All Rights Reserved.