本文整理汇总了Java中org.onlab.util.Tools.isPropertyEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Tools.isPropertyEnabled方法的具体用法?Java Tools.isPropertyEnabled怎么用?Java Tools.isPropertyEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onlab.util.Tools
的用法示例。
在下文中一共展示了Tools.isPropertyEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
String metricNameStr = Tools.get(properties, "metricNames");
metricNames = metricNameStr != null ? metricNameStr : DEFAULT_METRIC_NAMES;
log.info("Configured. Metric name is {}", metricNames);
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");
}
}
示例2: modified
import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
public void modified(ComponentContext context) {
Dictionary<?, ?> properties = context != null ? context.getProperties() : new Properties();
try {
String s = get(properties, "defaultVlan");
defaultVlan = isNullOrEmpty(s) ? DEFAULT_VLAN : Integer.parseInt(s.trim());
Boolean o = Tools.isPropertyEnabled(properties, "enableDhcpIgmpOnProvisioning");
if (o != null) {
enableDhcpIgmpOnProvisioning = o;
}
} catch (Exception e) {
defaultVlan = DEFAULT_VLAN;
}
}
示例3: modified
import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
Dictionary<?, ?> properties = context.getProperties();
Boolean flag;
flag = Tools.isPropertyEnabled(properties, "useStatefulSnat");
if (flag == null) {
log.info("useStatefulSnat is not configured, " +
"using current value of {}", useStatefulSnat);
} else {
useStatefulSnat = flag;
log.info("Configured. useStatefulSnat is {}",
useStatefulSnat ? "enabled" : "disabled");
}
resetSnatRules();
}
示例4: modified
import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
Dictionary<?, ?> properties = context.getProperties();
Boolean flag;
flag = Tools.isPropertyEnabled(properties, "useSecurityGroup");
if (flag == null) {
log.info("useSecurityGroup is not configured, " +
"using current value of {}", useSecurityGroup);
} else {
useSecurityGroup = flag;
log.info("Configured. useSecurityGroup is {}",
useSecurityGroup ? "enabled" : "disabled");
}
securityGroupService.setSecurityGroupEnabled(useSecurityGroup);
resetSecurityGroupRules();
}
示例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();
Boolean flag;
flag = Tools.isPropertyEnabled(properties, "purgeOnDisconnection");
if (flag == null) {
log.info("PurgeOnDisconnection is not configured, " +
"using current value of {}", purgeOnDisconnection);
} else {
purgeOnDisconnection = flag;
log.info("Configured. PurgeOnDisconnection is {}",
purgeOnDisconnection ? "enabled" : "disabled");
}
String s = get(properties, "fallbackGroupPollFrequency");
try {
fallbackGroupPollFrequency = isNullOrEmpty(s) ? DEFAULT_POLL_FREQUENCY : Integer.parseInt(s);
} catch (NumberFormatException e) {
fallbackGroupPollFrequency = DEFAULT_POLL_FREQUENCY;
}
}
示例6: 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 flag;
flag = Tools.isPropertyEnabled(properties, "hostRemovalEnabled");
if (flag == null) {
log.info("Host removal on port/device down events is not configured, " +
"using current value of {}", hostRemovalEnabled);
} else {
hostRemovalEnabled = flag;
log.info("Configured. Host removal on port/device down events is {}",
hostRemovalEnabled ? "enabled" : "disabled");
}
flag = Tools.isPropertyEnabled(properties, "ipv6NeighborDiscovery");
if (flag == null) {
log.info("Using IPv6 Neighbor Discovery is not configured, " +
"using current value of {}", ipv6NeighborDiscovery);
} else {
ipv6NeighborDiscovery = flag;
log.info("Configured. Using IPv6 Neighbor Discovery is {}",
ipv6NeighborDiscovery ? "enabled" : "disabled");
}
flag = Tools.isPropertyEnabled(properties, "requestInterceptsEnabled");
if (flag == null) {
log.info("Request intercepts is not configured, " +
"using current value of {}", requestInterceptsEnabled);
} else {
requestInterceptsEnabled = flag;
log.info("Configured. Request intercepts is {}",
requestInterceptsEnabled ? "enabled" : "disabled");
}
}
示例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();
Boolean flag;
flag = Tools.isPropertyEnabled(properties, "ipv6NeighborDiscovery");
if (flag == null) {
log.info("IPv6 Neighbor Discovery is not configured, " +
"using current value of {}", ipv6NeighborDiscovery);
} else {
ipv6NeighborDiscovery = flag;
log.info("Configured. IPv6 Neighbor Discovery is {}",
ipv6NeighborDiscovery ? "enabled" : "disabled");
}
}
示例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 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");
}
}
示例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();
Boolean flag;
flag = Tools.isPropertyEnabled(properties, "allowExtraneousRules");
if (flag == null) {
log.info("AllowExtraneousRules is not configured, " +
"using current value of {}", allowExtraneousRules);
} else {
allowExtraneousRules = flag;
log.info("Configured. AllowExtraneousRules is {}",
allowExtraneousRules ? "enabled" : "disabled");
}
flag = Tools.isPropertyEnabled(properties, "purgeOnDisconnection");
if (flag == null) {
log.info("PurgeOnDisconnection is not configured, " +
"using current value of {}", purgeOnDisconnection);
} else {
purgeOnDisconnection = flag;
log.info("Configured. PurgeOnDisconnection is {}",
purgeOnDisconnection ? "enabled" : "disabled");
}
String s = get(properties, "fallbackFlowPollFrequency");
try {
fallbackFlowPollFrequency = isNullOrEmpty(s) ? DEFAULT_POLL_FREQUENCY : Integer.parseInt(s);
} catch (NumberFormatException e) {
fallbackFlowPollFrequency = DEFAULT_POLL_FREQUENCY;
}
}
示例10: 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 flag;
flag = Tools.isPropertyEnabled(properties, "purgeOnDisconnection");
if (flag == null) {
log.info("PurgeOnDisconnection is not configured, " +
"using current value of {}", purgeOnDisconnection);
} else {
purgeOnDisconnection = flag;
log.info("Configured. PurgeOnDisconnection is {}",
purgeOnDisconnection ? "enabled" : "disabled");
}
}
示例11: 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);
}
示例12: readConfiguration
import org.onlab.util.Tools; //导入方法依赖的package包/类
private void readConfiguration(ComponentContext context) {
Dictionary<?, ?> properties = context.getProperties();
Boolean autoRegisterEnabled =
Tools.isPropertyEnabled(properties, PROPERTY_AUTO_REGISTER_DIAG);
if (autoRegisterEnabled == null) {
log.warn("Auto Register is not configured, " +
"using current value of {}", autoRegister);
} else {
autoRegister = autoRegisterEnabled;
log.info("Configured. Auto Register is {}",
autoRegister ? "enabled" : "disabled");
}
}
开发者ID:MaoJianwei,项目名称:ONOS_Network_Troubleshooting_System,代码行数:15,代码来源:NetworkDiagnosticManager.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();
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");
}
}
示例14: readComponentConfiguration
import org.onlab.util.Tools; //导入方法依赖的package包/类
private void readComponentConfiguration(ComponentContext context) {
Dictionary<?, ?> properties = context.getProperties();
Boolean flag;
flag = Tools.isPropertyEnabled(properties, "forceUnprovision");
if (flag == null) {
log.info("ForceUnprovision is not configured, " +
"using current value of {}", forceUnprovision);
} else {
forceUnprovision = flag;
log.info("Configured. ForceUnprovision is {}",
forceUnprovision ? "enabled" : "disabled");
}
}
示例15: modified
import org.onlab.util.Tools; //导入方法依赖的package包/类
@Modified
private void modified(ComponentContext context) {
Boolean boolEnabled = Tools.isPropertyEnabled(context.getProperties(), "enabled");
if (boolEnabled != null) {
if (enabled && !boolEnabled) {
enabled = false;
disable();
} else if (!enabled && boolEnabled) {
enabled = true;
enable();
}
}
}