com.google.api.ads.common.lib.client
Class AdsServiceClient<S extends AdsSession,D extends AdsServiceDescriptor>

java.lang.Object
  extended by com.google.api.ads.common.lib.soap.SoapServiceClient<Object>
      extended by com.google.api.ads.common.lib.client.AdsServiceClient<S,D>
Type Parameters:
S - the type of AdsSession
D - the type of AdsServiceDescriptor
All Implemented Interfaces:
InvocationHandler
Direct Known Subclasses:
AdWordsServiceClient, DfaServiceClient, DfpServiceClient

public abstract class AdsServiceClient<S extends AdsSession,D extends AdsServiceDescriptor>
extends SoapServiceClient<Object>

The base class for all AdsServiceClients.

This class connects the user, handler, and underlying service client. It fulfills:

Author:
Adam Rogal, Joseph DiLallo

Constructor Summary
AdsServiceClient(Object soapClient, S adsSession, D adsServiceDescriptor, SoapClientHandlerInterface<Object> soapClientHandler, HeaderHandler<S,D> headerHandler, AdsServiceLoggers adsServiceLoggers)
          Constructor.
 
Method Summary
 S getAdsSession()
          Gets the ads session for this client.
protected  void logSoapCall(SoapCallReturn soapCallReturn)
          Logs a SOAP call.
 void setAdsSession(S session)
          Sets the ads session for this client.
protected  void setHeaders()
          Sets the headers for the service client.
 
Methods inherited from class com.google.api.ads.common.lib.soap.SoapServiceClient
callSoapClient, createSoapCall, getSoapClient, getSoapClientHandler, handleException, invoke, setEndpointAddress, unwrapSoapCallReturn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdsServiceClient

public AdsServiceClient(Object soapClient,
                        S adsSession,
                        D adsServiceDescriptor,
                        SoapClientHandlerInterface<Object> soapClientHandler,
                        HeaderHandler<S,D> headerHandler,
                        AdsServiceLoggers adsServiceLoggers)
Constructor.

Parameters:
soapClient - the SOAP client
adsSession - the session
adsServiceDescriptor - the service descriptor
soapClientHandler - the SOAP client handler
headerHandler - the header handler
adsServiceLoggers - the loggers
Method Detail

getAdsSession

public S getAdsSession()
Gets the ads session for this client.

Returns:
the ads session for this client

setAdsSession

public void setAdsSession(S session)
Sets the ads session for this client.

Parameters:
session - the ads session to set for this client

logSoapCall

protected void logSoapCall(SoapCallReturn soapCallReturn)
Description copied from class: SoapServiceClient
Logs a SOAP call.

Specified by:
logSoapCall in class SoapServiceClient<Object>
See Also:
logSoapCall(SoapCallReturn)

setHeaders

protected void setHeaders()
                   throws ServiceException,
                          AuthenticationException
Description copied from class: SoapServiceClient
Sets the headers for the service client.

Specified by:
setHeaders in class SoapServiceClient<Object>
Throws:
ServiceException - if there was a problem setting the headers
AuthenticationException - if there was a problem authenticating while setting headers
See Also:
setHeaders()


Copyright © 2012. All Rights Reserved.