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

java.lang.Object
  extended by com.google.api.ads.common.lib.factory.BaseAdsServiceClientFactory<C,S,D>
Type Parameters:
C - the type of AdsServiceClient
S - the type of AdsSession
D - the type of AdsServiceDescriptor
Direct Known Subclasses:
AdWordsServiceClientFactory, DfaServiceClientFactory, DfpServiceClientFactory

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

Base factory which creates service clients.

Author:
Adam Rogal

Constructor Summary
protected BaseAdsServiceClientFactory(com.google.inject.AbstractModule module)
          Constructor.
protected BaseAdsServiceClientFactory(AdsServiceClientFactory<C,S,D> adsServiceClientFactory)
          Constructor.
protected BaseAdsServiceClientFactory(com.google.inject.Injector injector)
          Constructor.
 
Method Summary
<T> T
getServiceClientAsInterface(S adsSession, Class<T> interfaceClass)
          Gets a client given a session and the class of the desired stub interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseAdsServiceClientFactory

protected BaseAdsServiceClientFactory(AdsServiceClientFactory<C,S,D> adsServiceClientFactory)
Constructor.

Parameters:
adsServiceClientFactory - the ads service client factory

BaseAdsServiceClientFactory

protected BaseAdsServiceClientFactory(com.google.inject.AbstractModule module)
Constructor.

Parameters:
module - the module used for injection

BaseAdsServiceClientFactory

protected BaseAdsServiceClientFactory(com.google.inject.Injector injector)
Constructor.

Parameters:
injector - the injector used for injection
Method Detail

getServiceClientAsInterface

public <T> T getServiceClientAsInterface(S adsSession,
                                         Class<T> interfaceClass)
                              throws ServiceException
Gets a client given a session and the class of the desired stub interface.

Parameters:
adsSession - the session associated with the desired client
interfaceClass - the class type of the desired client
Returns:
a client for the specified ads service
Throws:
ServiceException


Copyright © 2012. All Rights Reserved.