package net.vexelon.currencybg.srv;

import javax.ws.rs.core.MediaType;

/**
 * Global constants
 *
 */
public final class Defs {

	public static final String LOGGER_NAME = "net.vexelon.currencybg";

	/*
	 * DateTime
	 */
	public static final String DATETIME_TIMEZONE_SOFIA = "Europe/Sofia";
	public static final String DATETIME_DEFAULT_TIMEZONE = DATETIME_TIMEZONE_SOFIA;
	public static final String DATETIME_RESTR_FORMAT = "HH:mm";

	/*
	 * Global configuration
	 */
	public static final String CONFIG_PATH = System.getenv("CBG_CFG_PATH");
	public static final String CONFIG_FILENAME = "cbg.properties";
	public static final long CONFIG_RELOAD_INTERVAL = 10; // 10 seconds

	/*
	 * Database parameters
	 */
	public static final String DB_DRIVER = "com.mysql.jdbc.Driver";
	public static final String DB_NAME = "currencybg";
	public static final String DB_HOST = System.getenv("OPENSHIFT_MYSQL_DB_HOST");
	public static final String DB_PORT = System.getenv("OPENSHIFT_MYSQL_DB_PORT");
	public static final String DB_CONNECTION = String.format("jdbc:mysql://%s:%s/%s", DB_HOST, DB_PORT, DB_NAME);
	public static final String DB_USER = System.getenv("OPENSHIFT_MYSQL_DB_USERNAME");
	public static final String DB_PASSWORD = System.getenv("OPENSHIFT_MYSQL_DB_PASSWORD");

	public static final String DATEFORMAT_ISO_8601 = "yyyy-MM-dd'T'HH:mmZ";

	/*
	 * Currency update parameters
	 */
	public static final long UPDATE_FIRST_INTERVAL = 10; // 10 seconds
	public static final long UPDATES_PERIODIC_INTERVAL = 5 * 60; // 5 minutes

	/*
	 * Reporter thread parameters
	 */
	public static final long REPORTER_UPDATE_FIRST_INTERVAL = 10;// seconds
	public static final long REPORTER_UPDATES_PERIODIC_INTERVAL = 60 * 60;// 1
	                                                                      // hour
	/*
	 * Currencies
	 */
	public static final String BITCOINS = "BTC";

	/*
	 * HTTP API specific
	 */
	public static final String HEADER_APIKEY = "APIKey";
	public static final String API_JSON_CONTENT_TYPE = MediaType.APPLICATION_JSON_TYPE + ";charset=utf-8";

	public static final String DATE_FORMAT = "yyyy-MM-dd";
	public static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
	// public static final String DATETIME_FORMAT_ISO8601 =
	// "yyyy-MM-dd'T'HH:mm:ssZ";
}
@@ -514,19 +514,24 @@
 stem.get
-env
+Property
 (%22CBG_CF
@@ -814,20 +814,37 @@
 E = 
-%22currencybg%22
+System.getProperty(%22DB_NAME%22)
 ;%0A%09p
@@ -889,37 +889,26 @@
 stem.get
-env(%22OPENSHIFT_MYSQL_
+Property(%22
 DB_HOST%22
@@ -958,37 +958,26 @@
 stem.get
-env(%22OPENSHIFT_MYSQL_
+Property(%22
 DB_PORT%22
@@ -1138,37 +1138,26 @@
 stem.get
-env(%22OPENSHIFT_MYSQL_
+Property(%22
 DB_USERN
@@ -1219,29 +1219,18 @@
 .get
-env(%22OPENSHIFT_MYSQL_
+Property(%22
 DB_P

Use System.getProperty instead of System.getenv