Example usage for org.apache.commons.configuration Configuration getString

List of usage examples for org.apache.commons.configuration Configuration getString

Introduction

In this page you can find the example usage for org.apache.commons.configuration Configuration getString.

Prototype

String getString(String key, String defaultValue);

Source Link

Document

Get a string associated with the given configuration key.

Usage

From source file:com.microrisc.simply.network.usbcdc.CDCNetworkLayerFactory.java

/**
 * @return network layer parameters encapsulation object
 *//*w w  w  .j a va 2  s  .c  om*/
private NetworkLayerParams createNetworkLayerParams(NetworkConnectionStorage connectionStorage,
        Configuration configProps) {
    String portName = configProps.getString("networkLayer.type.cdc.port", AUTOCONF);
    return new NetworkLayerParams(connectionStorage, portName);
}

From source file:com.appeligo.search.util.SMSSender.java

public SMSSender() throws MalformedURLException {
    Configuration config = ConfigUtils.getSystemConfig();
    mailHost = config.getString("smtpServer", "localhost");
    password = config.getString("smtpSenderPassword");
    smtpUser = config.getString("smtpUser", "alerts@flip.tv");
    port = config.getInt("smtpPort", 25);
    epg = DefaultEpg.getInstance();/* w w  w  .  ja  v  a2  s .  c om*/
}

From source file:com.microrisc.simply.network.serial.v1.SerialNetworkLayerFactory.java

/**
 * Creates network layer parameters encapsulation object.
 * @param connectionStorage/* ww w .j  av a 2  s  .com*/
 * @param configProps
 * @return network layer parameters encapsulation object
 */
private NetworkLayerParams createNetworkLayerParams(NetworkConnectionStorage connectionStorage,
        Configuration configProps) {
    String portName = configProps.getString("networkLayer.type.serial.port", AUTOCONF);
    int serialBaudrate = configProps.getInt("networkLayer.type.serial.baudrate", 19200);
    return new NetworkLayerParams(connectionStorage, portName, serialBaudrate);
}

From source file:io.mindmaps.graql.internal.analytics.CountMapReduce.java

@Override
public void loadState(final Graph graph, final Configuration configuration) {
    this.memoryKey = configuration.getString(COUNT_MEMORY_KEY, DEFAULT_MEMORY_KEY);
    this.selectedTypes = new HashSet<>();
    configuration.getKeys(TYPE).forEachRemaining(key -> selectedTypes.add(configuration.getString(key)));
}

From source file:com.caricah.iotracah.datastore.ignitecache.internal.impl.MessageHandler.java

@Override
public void configure(Configuration configuration) {

    String cacheName = configuration.getString(CONFIG_IGNITECACHE_MESSAGE_CACHE_NAME,
            CONFIG_IGNITECACHE_MESSAGE_CACHE_NAME_VALUE_DEFAULT);
    setCacheName(cacheName);/*from   w ww  .  j  a  va2 s . co  m*/
}

From source file:com.boozallen.cognition.ingest.storm.bolt.logging.LogRecordDateBolt.java

@Override
public void configure(Configuration conf) throws ConfigurationException {
    super.configure(conf);

    dateFormat = conf.getString(DATE_FORMAT, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
    sample = conf.getDouble(SAMPLE, 0.01);

    Validate.notBlank(dateFormat);/*w ww .j a  va 2s.c o m*/

    validateDateFormat();
}

From source file:com.microrisc.simply.network.SimpleNetworkConnectionStorageFactory.java

/** Creates and returns COM-port configuration settings. */
private BaseCOMPortConnectionInfo getCOMConnectionInfo(Configuration networkConfig) throws SimplyException {
    String port = networkConfig.getString("port", "");
    if (port.equals("")) {
        throw new SimplyException("COM-port not specified");
    }// w  w w.  j av a 2 s  .  c om
    return new BaseCOMPortConnectionInfo(port);
}

From source file:com.microrisc.simply.network.SimpleNetworkConnectionStorageFactory.java

/** Creates and returns SPI-port configuration settings. */
private BaseSPIPortConnectionInfo getSPIConnectionInfo(Configuration networkConfig) throws SimplyException {
    String port = networkConfig.getString("port", "");
    if (port.equals("")) {
        throw new SimplyException("SPI-port not specified");
    }/* w ww  . ja v  a2 s. c o  m*/
    return new BaseSPIPortConnectionInfo(port);
}

From source file:io.servicecomb.serviceregistry.api.registry.MicroserviceFactory.java

private Microservice createMicroserviceFromDefinition(Configuration configuration) {
    Microservice microservice = new Microservice();
    microservice.setServiceName(/*w w w  .  j  ava  2 s .c  o  m*/
            configuration.getString(CONFIG_QUALIFIED_MICROSERVICE_NAME_KEY, DEFAULT_MICROSERVICE_NAME));
    microservice.setAppId(configuration.getString(CONFIG_APPLICATION_ID_KEY, DEFAULT_APPLICATION_ID));
    microservice.setVersion(
            configuration.getString(CONFIG_QUALIFIED_MICROSERVICE_VERSION_KEY, DEFAULT_MICROSERVICE_VERSION));
    microservice.setDescription(configuration.getString(CONFIG_QUALIFIED_MICROSERVICE_DESCRIPTION_KEY, ""));
    microservice.setLevel(configuration.getString(CONFIG_QUALIFIED_MICROSERVICE_ROLE_KEY, "FRONT"));
    microservice.setPaths(ConfigurePropertyUtils.getMicroservicePaths(configuration));
    Map<String, String> propertiesMap = MicroservicePropertiesLoader.INSTANCE.loadProperties(configuration);
    microservice.setProperties(propertiesMap);

    // set alias name when allow cross app
    if (allowCrossApp(propertiesMap)) {
        microservice.setAlias(Microservice.generateAbsoluteMicroserviceName(microservice.getAppId(),
                microservice.getServiceName()));
    }

    return microservice;
}

From source file:io.servicecomb.serviceregistry.config.AbstractPropertiesLoader.java

private String readExtendedPropertyClassName(Configuration configuration, String keyName) {
    String configKey = mergeStrings(getConfigOptionPrefix(), keyName);
    return configuration.getString(configKey, "");
}