public abstract class PayPalResource extends Object
| Constructor and Description |
|---|
PayPalResource() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
configureAndExecute(APIContext apiContext,
HttpMethod httpMethod,
String resourcePath,
Map<String,String> headersMap,
String payLoad,
Class<T> clazz)
Deprecated.
|
static <T> T |
configureAndExecute(APIContext apiContext,
HttpMethod httpMethod,
String resourcePath,
String payLoad,
Class<T> clazz)
Configures and executes REST call: Supports JSON
|
static <T> T |
configureAndExecute(String accessToken,
HttpMethod httpMethod,
String resourcePath,
String payLoad,
Class<T> clazz)
Deprecated.
|
static APICallPreHandler |
createAPICallPreHandler(Map<String,String> configurationMap,
String payLoad,
String resourcePath,
Map<String,String> headersMap,
String accessToken,
String requestId,
SDKVersion sdkVersion)
Returns a implementation of
APICallPreHandler for the underlying
layer. |
static String |
getClientID()
Return Client ID from configuration Map
|
static String |
getClientSecret()
Returns Client Secret from configuration Map
|
static String |
getLastRequest()
Returns the last request sent to the Service
|
static String |
getLastResponse()
Returns the last response returned by the Service
|
static OAuthTokenCredential |
getOAuthTokenCredential()
Returns OAuthTokenCredential instance using client ID and client secret loaded from configuration.
|
static OAuthTokenCredential |
initConfig(File file)
Initialize the system using a File(Properties file).
|
static OAuthTokenCredential |
initConfig(InputStream inputStream)
Initialize using
InputStream(of a Properties file).. |
static OAuthTokenCredential |
initConfig(Properties properties)
Initialize using Properties.
|
static void |
initializeToDefault()
Initialize to default properties
|
public static OAuthTokenCredential initConfig(File file) throws PayPalRESTException
file - File object of a properties entityPayPalRESTExceptionpublic static OAuthTokenCredential initConfig(Properties properties)
properties - Properties objectpublic static OAuthTokenCredential initConfig(InputStream inputStream) throws PayPalRESTException
InputStream(of a Properties file).. The system
is initialized using the given InputStream and if the
initialization succeeds the default 'sdk_config.properties' can only be
loaded by calling the method initializeToDefault(). The system is
initialized with the information after loading defaults for the
parameters that are not passed as part of the configuration. For defaults
see ConfigManagerinputStream - InputStreamPayPalRESTExceptionpublic static String getClientID()
public static String getClientSecret()
public static OAuthTokenCredential getOAuthTokenCredential()
public static void initializeToDefault()
throws PayPalRESTException
PayPalRESTExceptionpublic static String getLastRequest()
public static String getLastResponse()
public static <T> T configureAndExecute(String accessToken, HttpMethod httpMethod, String resourcePath, String payLoad, Class<T> clazz) throws PayPalRESTException
T - Response Type for de-serializationaccessToken - OAuth AccessToken to be used for the call.httpMethod - Http Method verbresourcePath - Resource URI pathpayLoad - Payload to Serviceclazz - Class object used in De-serializationPayPalRESTExceptionpublic static <T> T configureAndExecute(APIContext apiContext, HttpMethod httpMethod, String resourcePath, String payLoad, Class<T> clazz) throws PayPalRESTException
T - Response Type for de-serializationapiContext - APIContext to be used for the call.httpMethod - Http Method verbresource - Resource URI pathpayLoad - Payload to Serviceclazz - Class object used in De-serializationPayPalRESTExceptionpublic static <T> T configureAndExecute(APIContext apiContext, HttpMethod httpMethod, String resourcePath, Map<String,String> headersMap, String payLoad, Class<T> clazz) throws PayPalRESTException
T - apiContext - APIContext to be used for the call.httpMethod - Http Method verbresourcePath - Resource URI pathheadersMap - Optional headers MappayLoad - Payload to Serviceclazz - Class object used in De-serializationPayPalRESTExceptionpublic static APICallPreHandler createAPICallPreHandler(Map<String,String> configurationMap, String payLoad, String resourcePath, Map<String,String> headersMap, String accessToken, String requestId, SDKVersion sdkVersion)
APICallPreHandler for the underlying
layer.configurationMap - configuration MappayLoad - Raw payloadresourcePath - URI part of the resource operated onheadersMap - Custom HTTP headers mapaccessToken - OAuth TokenrequestId - PayPal Request IdsdkVersion - SDKVersion instanceCopyright © 2016. All Rights Reserved.