本文整理汇总了Java中org.snmp4j.SNMP4JSettings.setVariableTextFormat方法的典型用法代码示例。如果您正苦于以下问题:Java SNMP4JSettings.setVariableTextFormat方法的具体用法?Java SNMP4JSettings.setVariableTextFormat怎么用?Java SNMP4JSettings.setVariableTextFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.snmp4j.SNMP4JSettings
的用法示例。
在下文中一共展示了SNMP4JSettings.setVariableTextFormat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.snmp4j.SNMP4JSettings; //导入方法依赖的package包/类
/**
* Initializes the {@link SmiManager} instances used for structed management information (SMI)
*/
public void initialize() {
try {
smiManager = new SmiManager(license, new File(repositoryPath));
SNMP4JSettings.setOIDTextFormat(smiManager);
SNMP4JSettings.setVariableTextFormat(smiManager);
} catch (IOException e) {
Log.error("Failed to initialize SmiManager");
e.printStackTrace();
}
// TBD??
// If you need to disable full index formatting, then choose a different format below and uncomment the line:
// smiManager.setOidFormat(OIDFormat.ObjectNameAndDecodedIndex4RoundTrip);
}
示例2: main
import org.snmp4j.SNMP4JSettings; //导入方法依赖的package包/类
public static void main(String[] args) {
LogFactory.setLogFactory(new Log4jLogFactory());
Log4jPropertiesLoader.getInstance()
.loadPropertyOf(SneoSnmpRequest.class);
SmiSyntaxesPropertiesManager.getInstance().useExtendedSmi();
SNMP4JSettings.setVariableTextFormat(
SnmpRequestPropertiesLoader.getInstance().getVariableTextFormat()
);
SnmpRequest.main(args);
}
示例3: main
import org.snmp4j.SNMP4JSettings; //导入方法依赖的package包/类
public static void main(String[] args) {
LogFactory.setLogFactory(new Log4jLogFactory());
mx4j.log.Log.redirectTo(new Log4JLogger());
Log4jPropertiesLoader.getInstance().loadPropertyOf(HttpJmxAgent.class);
if (AgentPropertiesLoader.getInstance().extendSmiSyntaxes()) {
SmiSyntaxesPropertiesManager.getInstance().useExtendedSmi();
}
if (AgentPropertiesLoader.getInstance().extendTransportMappings()) {
TransportsPropertiesManager.getInstance().extendTransportMappings();
}
SNMP4JSettings.setVariableTextFormat(
ColonSeparatedOidTypeValueVariableTextFormat.getInstance()
);
Map<?, ?> params = parseArgs(args);
final HttpJmxAgent agent
= new HttpJmxAgent(
((Integer)ArgumentParser.getValue(params, "jmxPort", 0)).intValue(),
((Integer)ArgumentParser.getValue(params, "rmiPort", 0)).intValue()
);
agent.setConfigFilePath((String)ArgumentParser.getValue(params, "f", 0));
agent.start();
if (params.get("d") == null) {
ConsoleBlocker.block("** Hit Enter key to stop simulation **");
agent.stop();
try {
Thread.sleep(2000);
} catch (InterruptedException e1) {}
}
else {
agent.registerPojo(
new SimStopper(
new StopProcedure() {
public void stop() {
agent.stop(3000L);
}
}
),
"Tools:name=SimStopper"
);
}
}