com.google.api.ads.common.lib.auth
Class OAuth2Helper

java.lang.Object
  extended by com.google.api.ads.common.lib.auth.OAuth2Helper

public class OAuth2Helper
extends Object

OAuth2 helper functions.

Author:
Adam Rogal

Constructor Summary
OAuth2Helper(AdsServiceLoggers adsServiceLoggers, Long refreshWindowSeconds)
          Constructor.
 
Method Summary
 com.google.api.client.auth.oauth2.Credential refreshCredential(com.google.api.client.auth.oauth2.Credential credential)
          Refreshes the credential if within the refresh window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth2Helper

@Inject
public OAuth2Helper(AdsServiceLoggers adsServiceLoggers,
                           Long refreshWindowSeconds)
Constructor.

Parameters:
adsServiceLoggers - the loggers
refreshWindowSeconds - the refresh window in seconds
Method Detail

refreshCredential

public com.google.api.client.auth.oauth2.Credential refreshCredential(com.google.api.client.auth.oauth2.Credential credential)
                                                               throws IOException
Refreshes the credential if within the refresh window.

Throws:
IOException - if there was an problem refreshing the token


Copyright © 2012. All Rights Reserved.