com.google.api.ads.adwords.lib.factory
Class AdWordsServices

java.lang.Object
  extended by com.google.api.ads.adwords.lib.factory.AdWordsServices

public final class AdWordsServices
extends Object

Utility class to create AdWords service clients. The session is stored as a reference within the client so that the session may be altered to affect the behavior of the client.

Usage example:


 AdWordsSession session = new AdWordsSession.Builder()...build();
 CampaignServiceInterface campaignService =
    new  AdWordsServices().get(session, CampaignServiceInterface.class);
 campaignService.makeRequest(...);
 ...
 session.setClientCustomerId(...);
 campaignService.makeRequest(...);
 

Author:
Adam Rogal

Constructor Summary
AdWordsServices()
          Default constructor.
AdWordsServices(FactoryConfiguration factoryConfiguration)
          Constructor that takes a factory configuration.
 
Method Summary
<T> T
get(AdWordsSession adWordsSession, Class<T> interfaceClass)
          Gets a client for the service represented by the interface with a reference to the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdWordsServices

public AdWordsServices()
Default constructor.


AdWordsServices

public AdWordsServices(FactoryConfiguration factoryConfiguration)
Constructor that takes a factory configuration.

Parameters:
factoryConfiguration - the factory configuration
Method Detail

get

public <T> T get(AdWordsSession adWordsSession,
                 Class<T> interfaceClass)
Gets a client for the service represented by the interface with a reference to the session.

Type Parameters:
T - the service type
Parameters:
adWordsSession - the AdWords session
interfaceClass - the service interface class
Returns:
the client for the service


Copyright © 2012. All Rights Reserved.