public class Configuration
extends java.lang.Object
The configuration for the Amadeus API client. To initialize, use the builder as follows:
Amadeus amadeus =
Amadeus.builder("REPLACE_BY_YOUR_API_KEY", "REPLACE_BY_YOUR_API_SECRET").build();
Or pass in environment variables directly:
Amadeus.builder(System.getenv()).build();
| Modifier and Type | Method and Description |
|---|---|
Amadeus |
build()
Builds an Amadeus client with the provided credentials.
|
java.lang.String |
getClientId()
The client ID used to authenticate the API calls.
|
java.lang.String |
getClientSecret()
The client secret used to authenticate the API calls.
|
java.lang.String |
getCustomAppId()
An optional custom App ID to be passed in the User Agent to the server (Defaults to null).
|
java.lang.String |
getCustomAppVersion()
An optional custom App version to be passed in the User Agent to the server (Defaults to null).
|
java.lang.String |
getHost()
The optional custom host domain to use for API calls.
|
java.lang.String |
getHostname()
The the name of the server API calls are made to, 'production' or 'test'.
|
java.util.logging.Logger |
getLogger()
The logger that will be used to debug or warn to.
|
java.lang.String |
getLogLevel()
The log level.
|
int |
getPort()
The port to use.
|
boolean |
isSsl()
Wether to use SSL.
|
Configuration |
setCustomAppId(java.lang.String customAppId)
An optional custom App ID to be passed in the User Agent to the server (Defaults to null).
|
Configuration |
setCustomAppVersion(java.lang.String customAppVersion)
An optional custom App version to be passed in the User Agent to the server (Defaults to null).
|
Configuration |
setHost(java.lang.String host)
The optional custom host domain to use for API calls.
|
Configuration |
setHostname(java.lang.String hostname)
The the name of the server API calls are made to, 'production' or 'test'.
|
Configuration |
setLogger(java.util.logging.Logger logger)
The logger that will be used to debug or warn to.
|
Configuration |
setLogLevel(java.lang.String logLevel)
The log level.
|
Configuration |
setPort(int port)
The port to use.
|
Configuration |
setSsl(java.lang.Boolean ssl)
Whether to use SSL.
|
java.lang.String |
toString() |
public Amadeus build() throws java.lang.NullPointerException
java.lang.NullPointerException - when a client ID or client secret is missingpublic Configuration setHostname(java.lang.String hostname)
hostname - The name of the server API calls are made topublic Configuration setSsl(java.lang.Boolean ssl)
ssl - A boolean specifying if the connection should use SSLpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getClientId()
public java.lang.String getClientSecret()
public java.util.logging.Logger getLogger()
public Configuration setLogger(java.util.logging.Logger logger)
logger - The logger objectthis.public java.lang.String getLogLevel()
public Configuration setLogLevel(java.lang.String logLevel)
logLevel - The log level for the loggerthis.public java.lang.String getHostname()
public java.lang.String getHost()
public Configuration setHost(java.lang.String host)
host - The optional custom host domain to use for API calls.this.public boolean isSsl()
public int getPort()
public Configuration setPort(int port)
port - The port to use for the connectionthis.public java.lang.String getCustomAppId()
public Configuration setCustomAppId(java.lang.String customAppId)
customAppId - An optional custom App IDthis.public java.lang.String getCustomAppVersion()
public Configuration setCustomAppVersion(java.lang.String customAppVersion)
customAppVersion - An optional custom App versionthis.