当前位置: 首页>>代码示例>>Java>>正文


Java Tools.getIntegerProperty方法代码示例

本文整理汇总了Java中org.onlab.util.Tools.getIntegerProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Tools.getIntegerProperty方法的具体用法?Java Tools.getIntegerProperty怎么用?Java Tools.getIntegerProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onlab.util.Tools的用法示例。


在下文中一共展示了Tools.getIntegerProperty方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    Integer newPendingFutureTimeoutMinutes =
            Tools.getIntegerProperty(properties, "pendingFutureTimeoutMinutes");
    if (newPendingFutureTimeoutMinutes == null) {
        pendingFutureTimeoutMinutes = DEFAULT_PENDING_FUTURE_TIMEOUT_MINUTES;
        log.info("Pending future timeout is not configured, " +
                         "using current value of {}", pendingFutureTimeoutMinutes);
    } else {
        pendingFutureTimeoutMinutes = newPendingFutureTimeoutMinutes;
        log.info("Configured. Pending future timeout is configured to {}",
                 pendingFutureTimeoutMinutes);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:SimpleFlowRuleStore.java

示例2: modified

import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    if (context != null) {
        Dictionary<?, ?> properties = context.getProperties();
        pollFrequency = Tools.getIntegerProperty(properties, "pollFrequency",
                DEFAULT_POLL_FREQUENCY_SECONDS);
        log.info("Configured. Poll frequency is configured to {} seconds", pollFrequency);
    }

    if (!scheduledTasks.isEmpty()) {
        //cancel all previous tasks
        scheduledTasks.values().forEach(task -> task.cancel(false));
        //resubmit task with new timeout.
        Set<DeviceId> deviceSubjects =
                cfgService.getSubjects(DeviceId.class, GeneralProviderDeviceConfig.class);
        deviceSubjects.forEach(deviceId -> {
            if (!compareScheme(deviceId)) {
                // not under my scheme, skipping
                log.debug("{} is not my scheme, skipping", deviceId);
                return;
            }
            scheduledTasks.put(deviceId, schedulePolling(deviceId, true));
        });
    }

}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:27,代码来源:GeneralDeviceProvider.java

示例3: modified

import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    if (context != null) {
        Dictionary<?, ?> properties = context.getProperties();
        pollFrequency = Tools.getIntegerProperty(properties, "pollFrequency",
                                                 DEFAULT_POLL_FREQUENCY_SECONDS);
        log.info("Configured. Poll frequency is configured to {} seconds", pollFrequency);

        maxRetries = Tools.getIntegerProperty(properties, "maxRetries",
                DEFAULT_MAX_RETRIES);
        log.info("Configured. Number of retries is configured to {} times", maxRetries);
    }
    if (scheduledTask != null) {
        scheduledTask.cancel(false);
    }
    scheduledTask = schedulePolling();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:18,代码来源:NetconfDeviceProvider.java

示例4: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    String addressStr = Tools.get(properties, "address");
    address = addressStr != null ? addressStr : DEFAULT_ADDRESS;
    log.info("Configured. Ganglia server address is {}", address);

    String metricNameStr = Tools.get(properties, "metricNames");
    metricNames = metricNameStr != null ? metricNameStr : DEFAULT_METRIC_NAMES;
    log.info("Configured. Metric name is {}", metricNames);

    Integer portConfigured = Tools.getIntegerProperty(properties, "port");
    if (portConfigured == null) {
        port = DEFAULT_PORT;
        log.info("Ganglia port is not configured, default value is {}", port);
    } else {
        port = portConfigured;
        log.info("Configured. Ganglia port is configured to {}", port);
    }

    Integer ttlConfigured = Tools.getIntegerProperty(properties, "ttl");
    if (ttlConfigured == null) {
        ttl = DEFAULT_TTL;
        log.info("Ganglia TTL is not configured, default value is {}", ttl);
    } else {
        ttl = ttlConfigured;
        log.info("Configured. Ganglia TTL is configured to {}", ttl);
    }

    Boolean monitorAllEnabled = Tools.isPropertyEnabled(properties, "monitorAll");
    if (monitorAllEnabled == null) {
        log.info("Monitor all metrics is not configured, " +
                 "using current value of {}", monitorAll);
    } else {
        monitorAll = monitorAllEnabled;
        log.info("Configured. Monitor all metrics is {}",
                monitorAll ? "enabled" : "disabled");
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:45,代码来源:DefaultGangliaMetricsReporter.java

示例5: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    String addressStr = Tools.get(properties, "address");
    address = addressStr != null ? addressStr : DEFAULT_ADDRESS;
    log.info("Configured. InfluxDB server address is {}", address);

    String databaseStr = Tools.get(properties, "database");
    database = databaseStr != null ? databaseStr : DEFAULT_DATABASE;
    log.info("Configured. InfluxDB server database is {}", database);

    String usernameStr = Tools.get(properties, "username");
    username = usernameStr != null ? usernameStr : DEFAULT_USERNAME;
    log.info("Configured. InfluxDB server username is {}", username);

    String passwordStr = Tools.get(properties, "password");
    password = passwordStr != null ? passwordStr : DEFAULT_PASSWORD;
    log.info("Configured. InfluxDB server password is {}", password);

    Integer portConfigured = Tools.getIntegerProperty(properties, "port");
    if (portConfigured == null) {
        port = DEFAULT_PORT;
        log.info("InfluxDB port is not configured, default value is {}", port);
    } else {
        port = portConfigured;
        log.info("Configured. InfluxDB port is configured to {}", port);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:34,代码来源:InfluxDbMetricsConfig.java

示例6: modified

import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    Integer poolSize = Tools.getIntegerProperty(properties, "sharedThreadPoolSize");

    if (poolSize != null && poolSize > 1) {
        sharedThreadPoolSize = poolSize;
        SharedExecutors.setPoolSize(sharedThreadPoolSize);
    } else if (poolSize != null) {
        log.warn("sharedThreadPoolSize must be greater than 1");
    }

    Integer timeLimit = Tools.getIntegerProperty(properties, "maxEventTimeLimit");
    if (timeLimit != null && timeLimit > 1) {
        maxEventTimeLimit = timeLimit;
        eventDeliveryService.setDispatchTimeLimit(maxEventTimeLimit);
    } else if (timeLimit != null) {
        log.warn("maxEventTimeLimit must be greater than 1");
    }

    Boolean performanceCheck = Tools.isPropertyEnabled(properties, "sharedThreadPerformanceCheck");
    if (performanceCheck != null) {
        calculatePoolPerformance = performanceCheck;
        SharedExecutors.setCalculatePoolPerformance(calculatePoolPerformance, metricsService);
    }

    log.info("Settings: sharedThreadPoolSize={}, maxEventTimeLimit={}, calculatePoolPerformance={}",
             sharedThreadPoolSize, maxEventTimeLimit, calculatePoolPerformance);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:30,代码来源:CoreManager.java

示例7: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    Integer newHeartbeatInterval = Tools.getIntegerProperty(properties,
                                                            "heartbeatInterval");
    if (newHeartbeatInterval == null) {
        setHeartbeatInterval(DEFAULT_HEARTBEAT_INTERVAL);
        log.info("Heartbeat interval time is not configured, default value is {}",
                 DEFAULT_HEARTBEAT_INTERVAL);
    } else {
        setHeartbeatInterval(newHeartbeatInterval);
        log.info("Configured. Heartbeat interval time is configured to {}",
                 heartbeatInterval);
    }

    Integer newPhiFailureThreshold = Tools.getIntegerProperty(properties,
                                                              "phiFailureThreshold");
    if (newPhiFailureThreshold == null) {
        setPhiFailureThreshold(DEFAULT_PHI_FAILURE_THRESHOLD);
        log.info("Phi failure threshold is not configured, default value is {}",
                 DEFAULT_PHI_FAILURE_THRESHOLD);
    } else {
        setPhiFailureThreshold(newPhiFailureThreshold);
        log.info("Configured. Phi failure threshold is configured to {}",
                 phiFailureThreshold);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:33,代码来源:DistributedClusterStore.java

示例8: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    String lispAuthKeyStr = Tools.get(properties, "lispAuthKey");
    lispAuthKey = lispAuthKeyStr != null ? lispAuthKeyStr : DEFAULT_LISP_AUTH_KEY;
    authConfig.updateLispAuthKey(lispAuthKey);
    log.info("Configured. LISP authentication key is {}", lispAuthKey);

    Integer lispAuthMethodInt = Tools.getIntegerProperty(properties, "lispAuthKeyId");
    if (lispAuthMethodInt == null) {
        lispAuthKeyId = DEFAULT_LISP_AUTH_KEY_ID;
        log.info("LISP authentication method is not configured, default value is {}", lispAuthKeyId);
    } else {
        lispAuthKeyId = lispAuthMethodInt;
        log.info("Configured. LISP authentication method is configured to {}", lispAuthKeyId);
    }
    authConfig.updateLispAuthKeyId(lispAuthKeyId);

    Boolean enableSmr = Tools.isPropertyEnabled(properties, "enableSmr");
    if (enableSmr == null) {
        log.info("Enable SMR is not configured, " +
                "using current value of {}", this.enableSmr);
    } else {
        this.enableSmr = enableSmr;
        log.info("Configured. Sending SMR through map server is {}",
                this.enableSmr ? "enabled" : "disabled");
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:34,代码来源:LispControllerImpl.java

示例9: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    Integer newSchedulePeriod = Tools.getIntegerProperty(properties,
                                                         "schedulePeriod");
    if (newSchedulePeriod == null) {
        schedulePeriod = DEFAULT_SCHEDULE_PERIOD;
        log.info("Schedule period is not configured, default value is {}",
                 DEFAULT_SCHEDULE_PERIOD);
    } else {
        schedulePeriod = newSchedulePeriod;
        log.info("Configured. Schedule period is configured to {}", schedulePeriod);
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:20,代码来源:MastershipLoadBalancer.java

示例10: modified

import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    int updatedOvsdbPort = Tools.getIntegerProperty(properties, OVSDB_PORT);
    if (!Objects.equals(updatedOvsdbPort, ovsdbPort)) {
        ovsdbPort = updatedOvsdbPort;
    }

    log.info("Modified");
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:11,代码来源:DefaultOpenstackNodeHandler.java

示例11: modified

import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    Integer poolSize = Tools.getIntegerProperty(properties, "sharedThreadPoolSize");

    if (poolSize != null && poolSize > 1) {
        sharedThreadPoolSize = poolSize;
        SharedExecutors.setPoolSize(sharedThreadPoolSize);
    } else if (poolSize != null) {
        log.warn("sharedThreadPoolSize must be greater than 1");
    }

    Integer timeLimit = Tools.getIntegerProperty(properties, "maxEventTimeLimit");
    if (timeLimit != null && timeLimit >= 0) {
        maxEventTimeLimit = timeLimit;
        eventDeliveryService.setDispatchTimeLimit(maxEventTimeLimit);
    } else if (timeLimit != null) {
        log.warn("maxEventTimeLimit must be greater than or equal to 0");
    }

    Boolean performanceCheck = Tools.isPropertyEnabled(properties, "sharedThreadPerformanceCheck");
    if (performanceCheck != null) {
        calculatePoolPerformance = performanceCheck;
        SharedExecutors.setMetricsService(calculatePoolPerformance ? metricsService : null);
    }

    log.info("Settings: sharedThreadPoolSize={}, maxEventTimeLimit={}, calculatePoolPerformance={}",
             sharedThreadPoolSize, maxEventTimeLimit, calculatePoolPerformance);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:30,代码来源:CoreManager.java

示例12: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    Boolean newMonitorAll = Tools.isPropertyEnabled(properties, "monitorAll");
    if (newMonitorAll == null) {
        log.info("Monitor all metrics is not configured, " +
                "using current value of {}", monitorAll);
    } else {
        monitorAll = newMonitorAll;
        log.info("Configured. Monitor all metrics is {}, ",
                monitorAll ? "enabled" : "disabled");
    }

    String newMetricNames = Tools.get(properties, "metricNames");
    metricNames = newMetricNames != null ? newMetricNames : DEFAULT_METRIC_NAMES;
    log.info("Configured. Metric name is {}", metricNames);

    String newAddress = Tools.get(properties, "address");
    address = newAddress != null ? newAddress : DEFAULT_ADDRESS;
    log.info("Configured. Graphite monitoring server address is {}", address);

    Integer newPort = Tools.getIntegerProperty(properties, "port");
    if (newPort == null) {
        port = DEFAULT_PORT;
        log.info("Graphite port is not configured, default value is {}", port);
    } else {
        port = newPort;
        log.info("Configured. Graphite port is configured to {}", port);
    }

    Integer newReportPeriod = Tools.getIntegerProperty(properties, "reportPeriod");
    if (newReportPeriod == null) {
        reportPeriod = DEFAULT_REPORT_PERIOD;
        log.info("Report period of graphite server is not configured, " +
                "default value is {}", reportPeriod);
    } else {
        reportPeriod = newReportPeriod;
        log.info("Configured. Report period of graphite server" +
                " is configured to {}", reportPeriod);
    }

    String newMetricNamePrefix = Tools.get(properties, "metricNamePrefix");
    metricNamePrefix = newMetricNamePrefix != null ?
            newMetricNamePrefix : DEFAULT_METRIC_NAME_PREFIX;

}
 
开发者ID:shlee89,项目名称:athena,代码行数:52,代码来源:DefaultGraphiteMetricsReporter.java

示例13: readComponentConfiguration

import org.onlab.util.Tools; //导入方法依赖的package包/类
/**
 * Extracts properties from the component configuration context.
 *
 * @param context the component context
 */
private void readComponentConfiguration(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    maxPaths = Tools.getIntegerProperty(properties, MAX_PATHS, DEFAULT_MAX_PATHS);
    log.info("Configured. Maximum paths to consider is configured to {}", maxPaths);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:11,代码来源:OpticalPathProvisioner.java

示例14: modified

import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    Boolean flag;

    flag = Tools.isPropertyEnabled(properties, "arpEnabled");
    if (flag != null) {
        arpEnabled = flag;
        log.info("Address resolution protocol is {}",
                arpEnabled ? "enabled" : "disabled");
    }

    if (arpEnabled) {
        requestArpPackets();
    } else {
        cancelArpPackets();
    }

    int intervalVal = Tools.getIntegerProperty(properties, "dhcpPollInterval");
    log.info("DhcpRelay poll interval new {} old {}", intervalVal, dhcpPollInterval);
    if (intervalVal !=  dhcpPollInterval) {
        timerExecutor.shutdown();
        dhcpPollInterval = intervalVal;
        timerExecutor = Executors.newScheduledThreadPool(1,
                groupedThreads("dhcpRelay",
                        "config-reloader-%d", log));
        timerExecutor.scheduleAtFixedRate(new Dhcp6Timer(),
                    0,
                    dhcpPollInterval > 1 ? dhcpPollInterval : 1,
                    TimeUnit.SECONDS);
        v6Handler.setDhcp6PollInterval(dhcpPollInterval);
    }

    flag = Tools.isPropertyEnabled(properties, "dhcpFpmEnabled");
    if (flag != null) {
        boolean oldValue = dhcpFpmEnabled;
        dhcpFpmEnabled = flag;
        log.info("DhcpRelay FPM is {}",
                dhcpFpmEnabled ? "enabled" : "disabled");

        if (dhcpFpmEnabled && !oldValue) {
            log.info("Dhcp Fpm is enabled.");
            processDhcpFpmRoutes(true);
        }
        if (!dhcpFpmEnabled && oldValue) {
            log.info("Dhcp Fpm is disabled.");
            processDhcpFpmRoutes(false);
        }
        v6Handler.setDhcpFpmEnabled(dhcpFpmEnabled);
    }

}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:53,代码来源:DhcpRelayManager.java


注:本文中的org.onlab.util.Tools.getIntegerProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。