Changes since
the last release

com.ebay.sdk
Class ApiContext

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

public class ApiContext
extends Object

Defines API context under which the API call will be made. To successfully make eBay API call, you need both API account and a normal eBay account. ApiContext also controls additional things like logging, CallRetry etc.

If you use eBay token as credential to make the API call you only need to set the eBayToken property. Otherwise you need to use setApiAccount() and seteBayAccount() together to set the account credential for the API call.

View UML diagram of the class.

Title:

Description:

Copyright: Copyright (c) 2004 - 2007

Company: eBay Inc.


Constructor Summary
ApiContext()
          Constructor.
 
Method Summary
 ApiCredential getApiCredential()
          Get the ApiAccount to use.
 ApiLogging getApiLogging()
          Gets the ApiLogging property.
 String getApiServerUrl()
          Get URL of the eBay API server to which the API call will be made.
 CallRetry getCallRetry()
          Get the CallRetry object.
 String getEpsServerUrl()
          Returns the epsServerUrl.
 String getErrorLanguage()
          Get language string to return error.
 String getRequestXml()
           
 String getResponseXml()
           
 String getRouting()
          Returns the routing.
 String getSignInUrl()
          Get SignIn Url.
 SiteCodeType getSite()
          Gets the site for API calls under the context.
 int getTimeout()
          Get timeout for HTTP connection.
 int getTotalCalls()
          Get total number of API calls that have been made with the ApiContext object.
 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 to use.
 void setApiLogging(ApiLogging apiLogging)
          Sets the ApiLogging property.
 void setApiServerUrl(String url)
          Set the URL of the eBay API server to which the API call will be made.
 void setCallRetry(CallRetry callRetry)
          Set the CallRetry object to be used to control the retry behaviour of calls.
 void setEpsServerUrl(String epsServerUrl)
          Sets the epsServerUrl.
 void setErrorLanguage(String errorLanguage)
          Set the error language string.
 void setRequestXml(String requestXml)
           
 void setResponseXml(String responseXml)
           
 void setRouting(String routing)
          Sets the gateway routing.
 void setSignInUrl(String url)
          Set SignIn Url.
 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 of HTTP connection.
 void setTotalCalls(int totalCalls)
          Set total number of API calls made with the ApiContext object.
 void setWSDLVersion(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 HTTP connection.

Returns:
the timeout value in milliseconds.

setTimeout

public void setTimeout(int timeout)
Set timeout of HTTP connection.

Parameters:
timeout - the timeout value to set. In milliseconds.

getApiServerUrl

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

Returns:
URL string of the eBay API server.

setApiServerUrl

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

Parameters:
url - The URL string to set.

getSignInUrl

public String getSignInUrl()
Get SignIn Url.

Returns:
string SignIn Url.

setSignInUrl

public void setSignInUrl(String url)
Set SignIn Url. param string SignIn Url.


getApiCredential

public ApiCredential getApiCredential()
Get the ApiAccount to use.

Returns:
the ApiAccount instance.

setApiCredential

public void setApiCredential(ApiCredential apiCredential)
Set the ApiCredential to use.

Parameters:
apiCredential - the ApiCredential instance to be set to.

getErrorLanguage

public String getErrorLanguage()
Get language string to return error.

Returns:
the error language string.

setErrorLanguage

public void setErrorLanguage(String errorLanguage)
Set the error language string.

Parameters:
errorLanguage - the error language string to be set to.

getApiLogging

public ApiLogging getApiLogging()
Gets the ApiLogging property.

Returns:
The ApiLogging object.

setApiLogging

public void setApiLogging(ApiLogging apiLogging)
Sets the ApiLogging property.

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 String getEpsServerUrl()
Returns the epsServerUrl.

Returns:
String

setRouting

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

Parameters:
routing - The routing to set

getRouting

public String getRouting()
Returns the routing.

Returns:
String

setEpsServerUrl

public void setEpsServerUrl(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 String getWSDLVersion()
Gets the version of WSDL version to be used.

Returns:
String

setWSDLVersion

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

Parameters:
wsdlVersion - String

getRequestXml

public String getRequestXml()

setRequestXml

public void setRequestXml(String requestXml)

getResponseXml

public String getResponseXml()

setResponseXml

public void setResponseXml(String responseXml)

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-2006 eBay Inc. All rights reserved.