Config
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using ru.iris.common.Config (Showing top 16 results out of 315)

origin: MrNeuronix/IRISv2

@Override
public void start() {
  Config config = Config.getInstance();
  LOGGER.info("[Plugin] iris-devices-zwave plugin started!");
  if (config.get("zwaveEnabled").equals("1")) {
    LOGGER.info("ZWave support enabled. Starting");
    service = new ZWaveService();
  }
}
origin: MrNeuronix/IRISv2

/**
 * Default constructor which loads properties from different storages.
 */
private Config()
{
  synchronized (Config.class)
  {
    if (propertyMap != null)
    {
      return;
    }
    propertyMap = new ConcurrentHashMap<>();
    loadPropertiesFromClassPath("/conf/iris-default.properties");
    if (!loadPropertiesFromClassPath("/conf/iris-extended.properties"))
    {
      if (!loadPropertiesFromFileSystem("/conf/iris-extended.properties"))
      {
        loadPropertiesFromFileSystem("./conf/main.property");
      }
    }
    loadPropertiesFromDatabase();
  }
}
origin: MrNeuronix/IRISv2

  @Override
  public String getAWSSecretKey() {
    return cfg.get("ivonaSecretKey");
  }
};
origin: MrNeuronix/IRISv2

public WitAiService()
  final Config cfg = Config.getInstance();
  final Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
origin: MrNeuronix/IRISv2

  conf.set("silence", "1");
} else {
  conf.set("silence", "0");
origin: MrNeuronix/IRISv2

@Override
public String getAWSAccessKeyId() {
  return cfg.get("ivonaAccessKey");
}
origin: MrNeuronix/IRISv2

@Override
public void start() {
  Config config = Config.getInstance();
  LOGGER.info("[Plugin] iris-devices-noolite plugin started!");
  if (config.get("nooliteEnabled").equals("1")) {
    LOGGER.info("NooLite support enabled. Starting");
    if (config.get("nooliteTXPresent").equals("1")) {
      LOGGER.info("NooLite TX support enabled. Starting");
      txService = new NooliteTXService();
    }
    if (config.get("nooliteRXPresent").equals("1")) {
      LOGGER.info("NooLite RX support enabled. Starting");
      rxService = new NooliteRXService();
    }
  }
}
origin: MrNeuronix/IRISv2

  public void stop() {
    messaging.close();
    manager.removeWatcher(watcher, null);
    manager.removeDriver(config.get("zwavePort"));
  }
}
origin: MrNeuronix/IRISv2

@Override
public void start()
{
  LOGGER.info("[Plugin] iris-ai plugin started!");
  Config cfg = Config.getInstance();
  if (cfg.get("witaiEnabled").equals("1"))
  {
    witai = new WitAiService();
  }
  else
  {
    LOGGER.info("No AI specified in config file");
  }
}
origin: MrNeuronix/IRISv2

if (conf.get("silence").equals("0")) {
origin: MrNeuronix/IRISv2

public JsonConnection()
{
  // Create a ConnectionFactory
  ConnectionFactory connectionFactory = new ConnectionFactory();
  // Create a Connection
  try
  {
    Config config = Config.getInstance();
    // Create a ConnectionFactory
    connectionFactory.setHost(config.get("AMQPhost"));
    connectionFactory.setPort(Integer.valueOf(config.get("AMQPport")));
    connectionFactory.setUsername(config.get("AMQPuser"));
    connectionFactory.setPassword(config.get("AMQPpasswd"));
    /*
     The AMQ connection.
     */
    Connection connection = connectionFactory.newConnection();
    channel = connection.createChannel();
    // Create exchange
    channel.exchangeDeclare("iris", "topic", true);
  } catch (IOException | TimeoutException e) {
    LOGGER.error("Error while connection to AMQP broker: " + e.getMessage());
    System.exit(1);
  }
}
origin: MrNeuronix/IRISv2

httpget.addHeader("Authorization", "Bearer " + cfg.get("witaiKey"));
origin: MrNeuronix/IRISv2

final Config conf = Config.getInstance();
String tts = conf.get("ttsEngine");
    synthesiser = new GoogleSynthesiser(conf.get("googleKey"));
    break;
  case "yandex":
    synthesiser = new YandexSynthesiser(conf.get("yandexKey"));
    break;
  case "ivona":
synthesiser.setLanguage(conf.get("language"));
origin: MrNeuronix/IRISv2

Voice voice = new Voice();
voice.setName(cfg.get("ivonaVoice"));
input.setData(synthText);
origin: MrNeuronix/IRISv2

LOGGER.info("Weather service started (LAT: " + conf.get("weatherLatitude") + ", LON: " + conf.get("weatherLongitude") + ")");
        DBLogger.info("Getting weather...");
        ForecastIO fio = new ForecastIO(conf.get("weatherApi"));
        fio.setUnits(ForecastIO.UNITS_SI);
        fio.getForecast(conf.get("weatherLatitude"), conf.get("weatherLongitude"));
        fio.setLang(ForecastIO.LANG_RUSSIAN);
origin: MrNeuronix/IRISv2

final Options options = Options.create(config.get("openzwaveCfgPath"), "", "");
options.addOptionBool("ConsoleOutput", Boolean.parseBoolean(config.get("zwaveDebug")));
options.addOptionString("UserPath", "conf/", true);
options.lock();
manager.addDriver(config.get("zwavePort"));
ru.iris.commonConfig

Javadoc

Class for loading configuration from properties files and database.

Most used methods

  • get
  • getInstance
  • loadPropertiesFromClassPath
    Loads given properties file from class path.
  • loadPropertiesFromDatabase
    Loads properties from database.
  • loadPropertiesFromFileSystem
    Loads given properties file from file system.
  • set

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)