com.zipwhip.api.ApiConnectionConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zipwhip-api Show documentation
Show all versions of zipwhip-api Show documentation
Java client to support applications powered by the Zipwhip Cloud
The newest version!
package com.zipwhip.api;
/**
* Get a configured, or default if not configured, configuration for connecting to Zipwhip web and signals APIs.
*
* To configure set a Java VM option {@code -Dzw_env=} with one of the following values:
*
* prod-https : Connection to production with HTTPS
*
* prod-http : Connection to production with HTTP
*
* staging : Connection to staging
*
* test : Connection to test
*
* The default is prod-https.
*/
public class ApiConnectionConfiguration {
static {
String environment = System.getProperty("zw_env", "prod-https");
if (environment.equals("prod-http")) {
API_HOST = ApiConnection.DEFAULT_HOST;
SIGNALS_HOST = ApiConnection.DEFAULT_SIGNALS_HOST;
SIGNALS_PORT = ApiConnection.DEFAULT_SIGNALS_PORT;
} else if (environment.equals("staging")) {
API_HOST = ApiConnection.STAGING_HOST;
SIGNALS_HOST = ApiConnection.STAGING_SIGNALS_HOST;
SIGNALS_PORT = ApiConnection.DEFAULT_SIGNALS_PORT;
} else if (environment.equals("test")) {
API_HOST = ApiConnection.TEST_HOST;
SIGNALS_HOST = ApiConnection.TEST_SIGNALS_HOST;
SIGNALS_PORT = ApiConnection.DEFAULT_SIGNALS_PORT;
} else { // DEFAULT: prod-https
API_HOST = ApiConnection.DEFAULT_HTTPS_HOST;
SIGNALS_HOST = ApiConnection.DEFAULT_SIGNALS_HOST;
SIGNALS_PORT = ApiConnection.DEFAULT_SIGNALS_PORT;
}
}
public static String API_HOST;
public static String SIGNALS_HOST;
public static int SIGNALS_PORT;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy