|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.paypal.base.rest.PayPalResource
public abstract class PayPalResource
PayPalResource acts as a base class for REST enabled resources.
| Constructor Summary | |
|---|---|
PayPalResource()
|
|
| Method Summary | ||
|---|---|---|
static
|
configureAndExecute(APIContext apiContext,
HttpMethod httpMethod,
String resourcePath,
Map<String,String> headersMap,
String payLoad,
Class<T> clazz)
Deprecated. |
|
static
|
configureAndExecute(APIContext apiContext,
HttpMethod httpMethod,
String resourcePath,
String payLoad,
Class<T> clazz)
Configures and executes REST call: Supports JSON |
|
static
|
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 |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PayPalResource()
| Method Detail |
|---|
public static OAuthTokenCredential initConfig(File file)
throws PayPalRESTException
file - File object of a properties entity
PayPalRESTExceptionpublic static OAuthTokenCredential initConfig(Properties properties)
properties - Properties object
public 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 ConfigManager
inputStream - InputStream
PayPalRESTExceptionpublic 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-serialization
PayPalRESTException
public 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-serialization
PayPalRESTException
public 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-serialization
PayPalRESTException
public 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 instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||