Changes since
the last release

com.ebay.sdk
Class ApiContext

java.lang.Object
  extended by com.ebay.sdk.ApiContext

public class ApiContext
extends java.lang.Object

Defines the API context with which an API call will be made. The APi context contains a variety of information, such as the credentials of the application and the user, the application's RuName, and the API server's URL.

If you have an auth token to use as credentials, you need only call ApiCredential#seteBayToken(String) to apply it. Otherwise you must call both ApiCredential.setApiAccount(ApiAccount) to set the application credentials and ApiCredential#seteBayAccount(eBayAccount) to set the user credentials.

Title:

Description:

Copyright: Copyright (c) 2004 - 2007

Company: eBay Inc.

Version:
1.0
Author:
Weijun Li

Constructor Summary
ApiContext()
          Constructor.
 
Method Summary
 ApiCredential getApiCredential()
          Get the ApiCredential object associated with this context.
 ApiLogging getApiLogging()
          Get the ApiLogging object associated with this context.
 java.lang.String getApiServerUrl()
          Get URL of the eBay API server to which the API call will be sent.
 CallRetry getCallRetry()
          Get the CallRetry object.
 java.lang.String getEpsServerUrl()
          Returns the epsServerUrl.
 java.lang.String getErrorLanguage()
          Get the language in which to return error messages.
 java.lang.String getRequestXml()
           
 java.lang.String getResponseXml()
           
 java.lang.String getRouting()
          Returns the routing.
 java.lang.String getRuName()
           
 java.lang.String getSignInUrl()
          Gets the URL of the User Consent Flow (the procedure in which the user gives consent for an application to perform API calls on his or her behalf).
 SiteCodeType getSite()
          Gets the site for API calls under the context.
 int getTimeout()
          Get timeout for the HTTP connection.
 int getTotalCalls()
          Get total number of API calls that have been made with the ApiContext object.
 java.lang.String getWSDLVersion()
          Gets the version of WSDL version to be used.
 int incrementTotalCalls()
          Increase number of total calls by one.
 void setApiCredential(ApiCredential apiCredential)
          Set the ApiCredential object associated with this context.
 void setApiLogging(ApiLogging apiLogging)
          Set the ApiLogging object associated with this context.
 void setApiServerUrl(java.lang.String url)
          Set URL of the eBay API server to which the API call will be sent.
 void setCallRetry(CallRetry callRetry)
          Set the CallRetry object to be used to control the retry behaviour of calls.
 void setEpsServerUrl(java.lang.String epsServerUrl)
          Sets the epsServerUrl.
 void setErrorLanguage(java.lang.String errorLanguage)
          Set the language in which to return error messages.
 void setRequestXml(java.lang.String requestXml)
           
 void setResponseXml(java.lang.String responseXml)
           
 void setRouting(java.lang.String routing)
          Sets the gateway routing.
 void setRuName(java.lang.String ruName)
           
 void setSignInUrl(java.lang.String url)
          Sets the URL of the User Consent Flow (the procedure in which the user gives consent for an application to perform API calls on his or her behalf).
 void setSite(SiteCodeType site)
          Sets the common eBay site that for all the APIs calls made with the ApiContext object.
 void setTimeout(int timeout)
          Set timeout for the HTTP connection.
 void setTotalCalls(int totalCalls)
          Set total number of API calls made with the ApiContext object.
 void setWSDLVersion(java.lang.String wsdlVersion)
          Sets the version of WSDL version to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApiContext

public ApiContext()
Constructor.

Method Detail

getTimeout

public int getTimeout()
Get timeout for the HTTP connection.

Returns:
the timeout value in milliseconds.

setTimeout

public void setTimeout(int timeout)
Set timeout for the HTTP connection.

Parameters:
timeout - the timeout value in milliseconds.

getApiServerUrl

public java.lang.String getApiServerUrl()
Get URL of the eBay API server to which the API call will be sent.

Returns:
URL string of the eBay API server.

setApiServerUrl

public void setApiServerUrl(java.lang.String url)
Set URL of the eBay API server to which the API call will be sent.

Parameters:
url - The URL string to set.

getSignInUrl

public java.lang.String getSignInUrl()
Gets the URL of the User Consent Flow (the procedure in which the user gives consent for an application to perform API calls on his or her behalf). For more information

see the description of setSignInUrl(String).

Returns:
The User Consent Flow's URL. The parameters are not included.

setSignInUrl

public void setSignInUrl(java.lang.String url)
Sets the URL of the User Consent Flow (the procedure in which the user gives consent for an application to perform API calls on his or her behalf).

For more information about the User Consent Flow, see the Trading API Reference's section Getting a Token via FetchToken. (Note that this section does use the term "User Consent Flow"; it refers to "the URL that takes the user to the eBay sign-in page for new token creation.")

Parameters:
url - The User Consent Flow's URL. The parameters should not be included.

getApiCredential

public ApiCredential getApiCredential()
Get the ApiCredential object associated with this context.

Returns:
The ApiCredential object associated with this context.

setApiCredential

public void setApiCredential(ApiCredential apiCredential)
Set the ApiCredential object associated with this context.

Parameters:
apiCredential - The ApiCredential object associated with this context.

getErrorLanguage

public java.lang.String getErrorLanguage()
Get the language in which to return error messages.

Returns:
the error language string.

setErrorLanguage

public void setErrorLanguage(java.lang.String errorLanguage)
Set the language in which to return error messages.

Parameters:
errorLanguage - the error language string.

getApiLogging

public ApiLogging getApiLogging()
Get the ApiLogging object associated with this context.

Returns:
The ApiLogging object.

setApiLogging

public void setApiLogging(ApiLogging apiLogging)
Set the ApiLogging object associated with this context.

Parameters:
apiLogging - ApiLogging

getCallRetry

public CallRetry getCallRetry()
Get the CallRetry object.

Returns:
The CallRetry object.

setCallRetry

public void setCallRetry(CallRetry callRetry)
Set the CallRetry object to be used to control the retry behaviour of calls. It controls the Call-Retry behavior of all API calls made with this ApiContext object. If you set ApiCall.CallRetry property of each individual call, the ApiContext.CallRetry will be overriden or ignored.

Parameters:
callRetry - the CallRetry object to use.

getTotalCalls

public int getTotalCalls()
Get total number of API calls that have been made with the ApiContext object. Each time when you successfully made an API call with the ApiContext object, the ApiCall instance will call setTotalCalls() to increment the total number of API calls.

Returns:
Total number of calls made.

setTotalCalls

public void setTotalCalls(int totalCalls)
Set total number of API calls made with the ApiContext object. This method is usually called by ApiCall object only.

Parameters:
totalCalls - Total number of calls to be set to.

incrementTotalCalls

public int incrementTotalCalls()
Increase number of total calls by one.

Returns:
The number of total calls made.

getEpsServerUrl

public java.lang.String getEpsServerUrl()
Returns the epsServerUrl.

Returns:
String

setRouting

public void setRouting(java.lang.String routing)
Sets the gateway routing.

Parameters:
routing - The routing to set

getRouting

public java.lang.String getRouting()
Returns the routing.

Returns:
String

setEpsServerUrl

public void setEpsServerUrl(java.lang.String epsServerUrl)
Sets the epsServerUrl.

Parameters:
epsServerUrl - The epsServerUrl to set

getSite

public SiteCodeType getSite()
Gets the site for API calls under the context.

Returns:
SiteCodeType

setSite

public void setSite(SiteCodeType site)
Sets the common eBay site that for all the APIs calls made with the ApiContext object. If an call object (inherited from ApiCall, e.g., AddItemCall) sets its Site property (ApiCall.setSite()) it will override this common eBay site property.

Parameters:
site - SiteCodeType

getWSDLVersion

public java.lang.String getWSDLVersion()
Gets the version of WSDL version to be used.

Returns:
String

setWSDLVersion

public void setWSDLVersion(java.lang.String wsdlVersion)
Sets the version of WSDL version to be used.

Parameters:
wsdlVersion - String

getRequestXml

public java.lang.String getRequestXml()

setRequestXml

public void setRequestXml(java.lang.String requestXml)

getResponseXml

public java.lang.String getResponseXml()

setResponseXml

public void setResponseXml(java.lang.String responseXml)

getRuName

public java.lang.String getRuName()

setRuName

public void setRuName(java.lang.String ruName)

Changes since
the last release

The information contained in this document is proprietary and confidential. Use of this information and the eBay API requires a Non-Disclosure Agreement (NDA) between the user and eBay Inc. For information regarding a qualifying NDA, contact Developer Relations: developer-relations@ebay.com
© 2004-2009 eBay Inc. All rights reserved.