public static class DfpSession.Builder extends Object implements Builder<DfpSession>
DfpSession.
Implementation is not thread-safe.
DEFAULT_CONFIGURATION_FILENAME| Constructor and Description |
|---|
DfpSession.Builder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DfpSession |
build()
Builds the
DfpSession. |
DfpSession.Builder |
from(org.apache.commons.configuration.Configuration config)
Reads properties from the provided
Configuration object.Known properties: api.dfp.clientLoginToken api.dfp.applicationName api.dfp.networkCode api.dfp.endpoint Deprecated: api.dfp.environment - e.g. |
DfpSession.Builder |
fromFile()
Loads credentials from "ads.properties" file in one of the following
locations according to the following order: in the current directory, in
the user home directory, in the classpath
|
DfpSession.Builder |
fromFile(File path)
Populates this builder from a properties file from a specified path.
|
DfpSession.Builder |
fromFile(String path)
Populates this builder from a properties file from a specified path.
|
DfpSession.Builder |
fromFile(URL path)
Populates this builder from a properties file from a specified path.
|
DfpSession.Builder |
withApplicationName(String applicationName)
Includes application name (any string of your choice).
|
DfpSession.Builder |
withClientLoginToken(String clientLoginToken)
Includes hard-coded ClientLogin token that will be used instead of
fetching a new one.
|
DfpSession.Builder |
withEndpoint(String endpoint)
Override the endpoint server.
|
DfpSession.Builder |
withEnvironment(DfpSession.Environment environment)
Deprecated.
|
DfpSession.Builder |
withNetworkCode(String networkCode)
Includes network code.
|
DfpSession.Builder |
withOAuth2Credential(com.google.api.client.auth.oauth2.Credential oAuth2Credential)
Includes OAuth2 credential to be used for OAuth2 authentication.
|
DfpSession.Builder |
withOAuthParameters(com.google.api.client.auth.oauth.OAuthParameters oAuthParameters)
Deprecated.
It is encouraged that you switch to OAuth2 at your earliest
convenience. Beginning in 1.9.0, the GoogleOAuth
authorization flow will no longer be supported, making it
substantially more difficult to create OAuth1.0a tokens.
|
public DfpSession.Builder fromFile() throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<DfpSession>com.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public DfpSession.Builder fromFile(String path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<DfpSession>path - the path to try first as a resource, then as a filecom.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public DfpSession.Builder fromFile(File path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<DfpSession>path - the path to load properties fromcom.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public DfpSession.Builder fromFile(URL path) throws com.google.api.ads.common.lib.conf.ConfigurationLoadException
BuilderfromFile in interface Builder<DfpSession>path - the path to try first as a resource, then as a filecom.google.api.ads.common.lib.conf.ConfigurationLoadException - if the configuration could not be
loaded.public DfpSession.Builder from(org.apache.commons.configuration.Configuration config)
Configuration object.from in interface Builder<DfpSession>config - the configurationpublic DfpSession.Builder withClientLoginToken(String clientLoginToken)
@Deprecated public DfpSession.Builder withOAuthParameters(com.google.api.client.auth.oauth.OAuthParameters oAuthParameters)
public DfpSession.Builder withOAuth2Credential(com.google.api.client.auth.oauth2.Credential oAuth2Credential)
public DfpSession.Builder withNetworkCode(String networkCode)
public DfpSession.Builder withApplicationName(String applicationName)
@Deprecated public DfpSession.Builder withEnvironment(DfpSession.Environment environment)
DfpSession.Environment.PRODUCTION.
Optional and defaults to DfpSession.Environment.PRODUCTION.
The environment and endpoint in DFP are currently synonymous. Setting an
environment will clear out any endpoint you have previously set.public DfpSession.Builder withEndpoint(String endpoint)
public DfpSession build() throws ValidationException
DfpSession.build in interface Builder<DfpSession>DfpSessionValidationException - if the DfpSession did not validateCopyright © 2013. All Rights Reserved.