public abstract class AbstractBoxResourceManager extends java.lang.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 java.lang.Class |
getClassFromType(IBoxType type) |
IBoxConfig |
getConfig() |
IBoxJSONParser |
getJSONParser() |
IBoxResourceHub |
getResourceHub() |
java.lang.Object |
getResponseAndParse(DefaultBoxRequest request,
IBoxType type,
IBoxJSONParser parser)
Make a rest api request, get response, and then parse the response.
|
java.lang.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 java.lang.Object |
tryCastBoxItem(BoxResourceType type,
java.lang.Object item)
Try to cast a box item into a concrete class(i.e.
|
java.lang.Object |
tryCastObject(IBoxType expectedType,
java.lang.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 java.lang.Object getResponseAndParseAndTryCast(DefaultBoxRequest request, IBoxType type, IBoxJSONParser parser) throws BoxRestException, AuthFatalFailureException, BoxServerException
public java.lang.Object getResponseAndParse(DefaultBoxRequest request, IBoxType type, IBoxJSONParser parser) throws BoxRestException, AuthFatalFailureException
public java.lang.Object tryCastObject(IBoxType expectedType, java.lang.Object obj) throws BoxServerException, BoxRestException
BoxServerException
BoxRestException
protected java.lang.Class getClassFromType(IBoxType type)
protected java.lang.Object tryCastBoxItem(BoxResourceType type, java.lang.Object item) throws BoxServerException, BoxRestException
BoxServerException
BoxRestException