|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.ads.dfa.lib.client.DfaSession.Builder
public static class DfaSession.Builder
Builder for DfaSession.
| Field Summary |
|---|
| Fields inherited from interface com.google.api.ads.common.lib.utils.Builder |
|---|
DEFAULT_CONFIGURATION_FILENAME |
| Constructor Summary | |
|---|---|
DfaSession.Builder()
Constructor. |
|
| Method Summary | |
|---|---|
DfaSession |
build()
Builds the DfaSession. |
DfaSession.Builder |
from(org.apache.commons.configuration.Configuration config)
Reads properties from the provided Configuration object.Known properties: api.dfa.username api.dfa.password api.dfa.applicationName api.dfa.token api.dfa.environment, e.g. |
DfaSession.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 |
DfaSession.Builder |
fromFile(File path)
Populates this builder from a properties file from a specified path. |
DfaSession.Builder |
fromFile(String path)
Populates this builder from a properties file from a specified path. |
DfaSession.Builder |
fromFile(URL path)
Populates this builder from a properties file from a specified path. |
DfaSession.Builder |
withApplicationName(String applicationName)
Includes application name. |
DfaSession.Builder |
withEndpoint(String endpoint)
Override the endpoint server. |
DfaSession.Builder |
withEnvironment(DfaSession.Environment environment)
Includes the specified environment, e.g. |
DfaSession.Builder |
withUsernameAndPassword(String username,
String password)
Includes username and password. |
DfaSession.Builder |
withUsernameAndToken(String username,
String token)
Includes a username with a hard-coded token to be used instead of fetching a new one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DfaSession.Builder()
| Method Detail |
|---|
public DfaSession.Builder fromFile()
Builder
fromFile in interface Builder<DfaSession>public DfaSession.Builder fromFile(String path)
Builder
fromFile in interface Builder<DfaSession>path - the path to try first as a resource, then as a file
public DfaSession.Builder fromFile(File path)
Builder
fromFile in interface Builder<DfaSession>path - the path to load properties from
public DfaSession.Builder fromFile(URL path)
Builder
fromFile in interface Builder<DfaSession>path - the path to try first as a resource, then as a file
public DfaSession.Builder from(org.apache.commons.configuration.Configuration config)
Configuration object.
from in interface Builder<DfaSession>config -
public DfaSession.Builder withEnvironment(DfaSession.Environment environment)
DfaSession.Environment.TEST
The environment and endpoint in DFA are currently synonymous. Setting an
environment will clear out any endpoint you have previously set.
public DfaSession.Builder withEndpoint(String endpoint)
public DfaSession.Builder withUsernameAndPassword(String username,
String password)
public DfaSession.Builder withUsernameAndToken(String username,
String token)
public DfaSession.Builder withApplicationName(String applicationName)
public DfaSession build()
throws ValidationException
DfaSession.
build in interface Builder<DfaSession>DfaSession
ValidationException - if the DfaSession did not validate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||