All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.netgrid.got.telegram.properties.TelegramPropertiesConfigurationImplementation Maven / Gradle / Ivy

package it.netgrid.got.telegram.properties;

import java.util.Properties;


public class TelegramPropertiesConfigurationImplementation extends PropertiesConfigurationTemplate
		implements TelegramPropertiesConfiguration {

	private static final String BOT_TOKEN = "bot_token";

	private static final String RECEIVE_TOPIC = "receive_topic";
	private static final String RECEIVE_TOPIC_DEFAULT_VALUE = "telegram_tx";

	private static final String SEND_TOPIC = "send_topic";
	private static final String SEND_TOPIC_DEFAULT_VALUE = "telegram_rx";

	private static final String ERROR_TOPIC = "error_topic";
	private static final String ERROR_TOPIC_DEFAULT_VALUE = "telegram_error";

	private static final String DEFAULT_CONFIG_PROPERTIES_PATH ="/etc/alfred-configuration/telegram.properties";
	private static final String DEFAULT_CONFIG_PROPERTIES_RESOURCE = System.getProperty("user.dir")+"/telegram.properties";

	private Properties properties;

	public TelegramPropertiesConfigurationImplementation() {
		properties = getProperties("telegram.properties");
	}

	@Override
	public String getBotToken() {
		return properties.getProperty(BOT_TOKEN);
	}

	@Override
	public String getSendTopic() {
		return properties.getProperty(SEND_TOPIC, SEND_TOPIC_DEFAULT_VALUE);
	}

	@Override
	public String getReceiveTopic() {
		return properties.getProperty(RECEIVE_TOPIC, RECEIVE_TOPIC_DEFAULT_VALUE);
	}

	@Override
	public String getErrorTopic() {
		return properties.getProperty(ERROR_TOPIC, ERROR_TOPIC_DEFAULT_VALUE);
	}

	@Override
	public String getDefaultConfigPropertiesPath() {
		return DEFAULT_CONFIG_PROPERTIES_PATH;
	}

	@Override
	public String getDefaultConfigPropertiesResource() {
		return DEFAULT_CONFIG_PROPERTIES_RESOURCE;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy