Java Code Examples for org.apache.commons.configuration.HierarchicalConfiguration#getLong()

The following examples show how to use org.apache.commons.configuration.HierarchicalConfiguration#getLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FakeSettings.java    From sailfish-core with Apache License 2.0 5 votes vote down vote up
@Override
public void load(HierarchicalConfiguration config)
{
	try {
           dictionaryName = SailfishURI.parse(config.getString("dictionaryName"));
       } catch(SailfishURIException e) {
           throw new EPSCommonException(e);
       }

	idleTimeout = config.getLong("idleTimeout");
}
 
Example 2
Source File: TCPIPProxySettings.java    From sailfish-core with Apache License 2.0 5 votes vote down vote up
@Override
public void load(HierarchicalConfiguration config)
{
	this.host = config.getString("host");
	this.port = config.getInt("port");
	this.listenPort = config.getInt("listenPort");
	this.codecClassName = config.getString("codecClass");
	this.timeout = config.getLong("timeout");
}
 
Example 3
Source File: JuniperUtils.java    From onos with Apache License 2.0 5 votes vote down vote up
/**
 * Parses neighbours discovery information and returns a list of
 * link abstractions.
 *
 * @param info interface configuration
 * @return set of link abstractions
 */
public static Set<LinkAbstraction> parseJuniperLldp(HierarchicalConfiguration info) {
    Set<LinkAbstraction> neighbour = new HashSet<>();
    List<HierarchicalConfiguration> subtrees =
            info.configurationsAt(LLDP_LIST_NBR_INFO);
    for (HierarchicalConfiguration neighborsInfo : subtrees) {
        List<HierarchicalConfiguration> neighbors =
                neighborsInfo.configurationsAt(LLDP_NBR_INFO);
        for (HierarchicalConfiguration neighbor : neighbors) {
            String localPortName = neighbor.getString(LLDP_LO_PORT);
            MacAddress mac = MacAddress.valueOf(neighbor.getString(LLDP_REM_CHASS));
            String remotePortId = null;
            long remotePortIndex = -1;
            String remotePortIdSubtype = neighbor.getString(LLDP_REM_PORT_SUBTYPE, null);
            if (remotePortIdSubtype != null) {
                if (remotePortIdSubtype.equals(LLDP_SUBTYPE_MAC)
                        || remotePortIdSubtype.equals(LLDP_SUBTYPE_INTERFACE_NAME)) {
                    remotePortId = neighbor.getString(LLDP_REM_PORT, null);
                } else {
                    remotePortIndex = neighbor.getLong(LLDP_REM_PORT, -1);
                }
            }
            String remotePortDescription = neighbor.getString(LLDP_REM_PORT_DES, null);
            LinkAbstraction link = new LinkAbstraction(
                    localPortName,
                    mac.toLong(),
                    remotePortIndex,
                    remotePortId,
                    remotePortDescription);
            neighbour.add(link);
        }
    }
    return neighbour;
}
 
Example 4
Source File: AbstractServiceSettings.java    From sailfish-core with Apache License 2.0 4 votes vote down vote up
public void load(HierarchicalConfiguration cfg) {
	this.expectedTimeOfStarting = cfg.getLong("expectedTimeOfStarting", 0L);
	this.waitingTimeBeforeStarting = cfg.getLong("waitingTimeBeforeStarting", 0L);
	this.comment = cfg.getString("comment", null);
}
 
Example 5
Source File: EnvironmentSettings.java    From sailfish-core with Apache License 2.0 3 votes vote down vote up
private void loadGeneralSettings(HierarchicalConfiguration config) {
	this.fileStoragePath = config.getString("FileStoragePath", "storage");

	this.storeAdminMessages = config.getBoolean("StoreAdminMessages", true);

	this.asyncRunMatrix = config.getBoolean(ASYNC_RUN_MATRIX_KEY, false);

	this.maxQueueSize = config.getLong(MAX_STORAGE_QUEUE_SIZE, 1024*1024*512);

	this.storageType = StorageType.parse(config.getString("StorageType", StorageType.DB.getName()));

       this.comparisonPrecision = config.getBigDecimal(COMPARISON_PRECISION, MathProcessor.COMPARISON_PRECISION);
}