com.google.api.ads.dfa.lib.client
Class DfaAxisHeaderHandler

java.lang.Object
  extended by com.google.api.ads.dfa.lib.client.DfaAxisHeaderHandler
All Implemented Interfaces:
HeaderHandler<DfaSession,DfaServiceDescriptor>

public class DfaAxisHeaderHandler
extends Object
implements HeaderHandler<DfaSession,DfaServiceDescriptor>

DFA implementation of HeaderHandler.

Author:
Adam Rogal

Constructor Summary
DfaAxisHeaderHandler(SoapClientHandlerInterface soapClientHandler, com.google.api.ads.dfa.lib.conf.DfaApiConfiguration dfaApiConfiguration, LoginTokens loginTokens, com.google.api.ads.dfa.lib.conf.DfaBuildConfiguration dfaBuildConfiguration)
          Constructor.
 
Method Summary
protected  String generateAuthToken(DfaServiceDescriptor dfaServiceDescriptor, DfaSession dfaSession)
          Generates an authentication token for use with the current session.
 void setHeaders(Object soapClient, DfaSession dfaSession, DfaServiceDescriptor dfaServiceDescriptor)
          Sets the headers on the SOAP client using the session and descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DfaAxisHeaderHandler

@Inject
public DfaAxisHeaderHandler(SoapClientHandlerInterface soapClientHandler,
                                   com.google.api.ads.dfa.lib.conf.DfaApiConfiguration dfaApiConfiguration,
                                   LoginTokens loginTokens,
                                   com.google.api.ads.dfa.lib.conf.DfaBuildConfiguration dfaBuildConfiguration)
Constructor.

Parameters:
soapClientHandler - the SOAP client handler
dfaApiConfiguration - the DFA API configuration
loginTokens - the login ticket provider
Method Detail

setHeaders

public void setHeaders(Object soapClient,
                       DfaSession dfaSession,
                       DfaServiceDescriptor dfaServiceDescriptor)
                throws AuthenticationException,
                       ServiceException
Description copied from interface: HeaderHandler
Sets the headers on the SOAP client using the session and descriptor.

Specified by:
setHeaders in interface HeaderHandler<DfaSession,DfaServiceDescriptor>
Parameters:
soapClient - the SOAP client
dfaSession - the ads session
dfaServiceDescriptor - the ads service descriptor
Throws:
AuthenticationException - if there was a problem authenticating the session
ServiceException - if there was a problem setting the headers
See Also:
HeaderHandler.setHeaders(Object, com.google.api.ads.common.lib.client.AdsSession, com.google.api.ads.common.lib.client.AdsServiceDescriptor)

generateAuthToken

protected String generateAuthToken(DfaServiceDescriptor dfaServiceDescriptor,
                                   DfaSession dfaSession)
                            throws LoginTokenException
Generates an authentication token for use with the current session.

Parameters:
dfaServiceDescriptor - the DFA service descriptor
dfaSession - the session in use
Returns:
an authentication token
Throws:
LoginTokenException - thrown if generating a token fails


Copyright © 2012. All Rights Reserved.