com.paypal.base
Class BaseService

java.lang.Object
  extended by com.paypal.base.BaseService

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


Field Summary
protected  Map<String,String> configurationMap
           
 
Constructor Summary
BaseService()
          Default Constructor
BaseService(InputStream inputStream)
          Constructs BaseService using the supplied InputStream for Properties configuration
BaseService(Map<String,String> configurationMap)
          Constructs BaseService using the supplied Map for configuration
BaseService(Properties properties)
          Constructs BaseService using the supplied Properties for configuration
 
Method Summary
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.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configurationMap

protected Map<String,String> configurationMap
Constructor Detail

BaseService

public BaseService()
Default Constructor


BaseService

public BaseService(InputStream inputStream)
            throws IOException
Constructs BaseService using the supplied InputStream for Properties configuration

Parameters:
inputStream - Properties configuration stream
Throws:
IOException

BaseService

public BaseService(Properties properties)
Constructs BaseService using the supplied Properties for configuration

Parameters:
properties - Configuration Properties

BaseService

public BaseService(Map<String,String> configurationMap)
Constructs BaseService using the supplied Map for configuration

Parameters:
configurationMap - Configuration Map
Method Detail

getAccessToken

public String getAccessToken()
Gets the Access Token

Returns:
the accessToken

setAccessToken

public void setAccessToken(String accessToken)
Deprecated. 

Sets the Access Token

Parameters:
accessToken - the accessToken to set

getTokenSecret

public String getTokenSecret()
Gets the Token Secret

Returns:
the tokenSecret

setTokenSecret

public void setTokenSecret(String tokenSecret)
Deprecated. 

Sets the Token Secret

Parameters:
tokenSecret - the tokenSecret to set

getLastRequest

public String getLastRequest()
Returns:
the lastRequest

setLastRequest

public void setLastRequest(String lastRequest)
Parameters:
lastRequest - the lastRequest to set

getLastResponse

public String getLastResponse()
Returns:
the lastResponse

setLastResponse

public void setLastResponse(String lastResponse)
Parameters:
lastResponse - the lastResponse to set

initializeToDefault

protected void initializeToDefault()
Initialize from sdk_config.properties


initConfig

protected static void initConfig(InputStream is)
                          throws IOException
Deprecated. 

Overloaded static method used to load the configuration file.

Parameters:
is -
Throws:
IOException

initConfig

protected static void initConfig(File file)
                          throws IOException
Deprecated. 

Overloaded static method used to load the configuration file

Parameters:
file -
Throws:
IOException

initConfig

protected static void initConfig(String filepath)
                          throws IOException
Deprecated. 

Overloaded static method used to load the configuration file

Parameters:
filepath -
Throws:
IOException

initConfig

protected static void initConfig(Properties properties)
Deprecated. 

Initializes ConfigManager with the passed Properties instance

Parameters:
properties - Properties instance

call

protected String call(APICallPreHandler apiCallPrehandler)
               throws InvalidResponseDataException,
                      HttpErrorException,
                      ClientActionRequiredException,
                      InvalidCredentialException,
                      MissingCredentialException,
                      OAuthException,
                      SSLConfigurationException,
                      IOException,
                      InterruptedException
Calls the APIService with the corresponding APICallPreHandler

Parameters:
apiCallPrehandler - APICallPreHandler instance
Returns:
Response as string from the API service
Throws:
InvalidResponseDataException
HttpErrorException
ClientActionRequiredException
InvalidCredentialException
MissingCredentialException
OAuthException
SSLConfigurationException
IOException
InterruptedException


Copyright © 2015. All Rights Reserved.