public abstract class BaseService extends Object
BaseService acts as base class for any concrete API service. The
Service class generated may extend this class to make API calls through HTTP| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
configurationMap |
| Constructor and Description |
|---|
BaseService()
Default Constructor
|
BaseService(InputStream inputStream)
|
BaseService(Map<String,String> configurationMap)
Constructs
BaseService using the supplied Map for
configuration |
BaseService(Properties properties)
Constructs
BaseService using the supplied Properties for
configuration |
| Modifier and Type | Method and Description |
|---|---|
protected String |
call(APICallPreHandler apiCallPrehandler)
Calls the APIService with the corresponding
APICallPreHandler |
String |
getAccessToken()
Gets the Access Token
|
String |
getLastRequest() |
String |
getLastResponse() |
String |
getTokenSecret()
Gets the Token Secret
|
protected static void |
initConfig(File file)
Deprecated.
|
protected static void |
initConfig(InputStream is)
Deprecated.
|
protected static void |
initConfig(Properties properties)
Deprecated.
|
protected static void |
initConfig(String filepath)
Deprecated.
|
protected void |
initializeToDefault()
Initialize from sdk_config.properties
|
void |
setAccessToken(String accessToken)
Deprecated.
|
void |
setLastRequest(String lastRequest) |
void |
setLastResponse(String lastResponse) |
void |
setTokenSecret(String tokenSecret)
Deprecated.
|
public BaseService()
public BaseService(InputStream inputStream) throws IOException
inputStream - Properties configuration streamIOExceptionpublic BaseService(Properties properties)
BaseService using the supplied Properties for
configurationproperties - Configuration Propertiespublic String getAccessToken()
public void setAccessToken(String accessToken)
accessToken - the accessToken to setpublic String getTokenSecret()
public void setTokenSecret(String tokenSecret)
tokenSecret - the tokenSecret to setpublic String getLastRequest()
public void setLastRequest(String lastRequest)
lastRequest - the lastRequest to setpublic String getLastResponse()
public void setLastResponse(String lastResponse)
lastResponse - the lastResponse to setprotected void initializeToDefault()
protected static void initConfig(InputStream is) throws IOException
is - IOExceptionprotected static void initConfig(File file) throws IOException
file - IOExceptionprotected static void initConfig(String filepath) throws IOException
filepath - IOExceptionprotected static void initConfig(Properties properties)
ConfigManager with the passed Properties
instanceproperties - Properties instanceprotected String call(APICallPreHandler apiCallPrehandler) throws InvalidResponseDataException, HttpErrorException, ClientActionRequiredException, InvalidCredentialException, MissingCredentialException, OAuthException, SSLConfigurationException, IOException, InterruptedException
APICallPreHandlerapiCallPrehandler - APICallPreHandler instanceInvalidResponseDataExceptionHttpErrorExceptionClientActionRequiredExceptionInvalidCredentialExceptionMissingCredentialExceptionOAuthExceptionSSLConfigurationExceptionIOExceptionInterruptedExceptionCopyright © 2016. All Rights Reserved.