本文整理汇总了Java中org.snmp4j.mp.MPv3.setEnterpriseID方法的典型用法代码示例。如果您正苦于以下问题:Java MPv3.setEnterpriseID方法的具体用法?Java MPv3.setEnterpriseID怎么用?Java MPv3.setEnterpriseID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.snmp4j.mp.MPv3
的用法示例。
在下文中一共展示了MPv3.setEnterpriseID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.snmp4j.mp.MPv3; //导入方法依赖的package包/类
/**
* Initialize for v3 communications
*/
private static void initialize() {
if (s_initialized) {
return;
}
// LogFactory.setLogFactory(new Log4jLogFactory());
MPv3.setEnterpriseID(5813);
USM usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(usm);
// Enable extensibility in SNMP4J so that we can subclass some SMI classes to work around
// agent bugs
if (System.getProperty("org.snmp4j.smisyntaxes", null) != null) {
SNMP4JSettings.setExtensibilityEnabled(true);
}
if (Boolean.getBoolean("org.opennms.snmp.snmp4j.forwardRuntimeExceptions")) {
SNMP4JSettings.setForwardRuntimeExceptions(true);
}
s_initialized = true;
}
示例2: setUp
import org.snmp4j.mp.MPv3; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
MockUtil.println("------------ Begin Test "+getName()+" --------------------------");
final Properties p = new Properties();
p.setProperty("log4j.logger.org.snmp4j", "DEBUG");
p.setProperty("log4j.logger.org.snmp4j.agent", "DEBUG");
MockLogAppender.setupLogging(true, p);
// Create a global USM that all client calls will use
MPv3.setEnterpriseID(5813);
m_usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(m_usm);
m_agent = MockSnmpAgent.createAgentAndRun(new ClassPathResource("loadSnmpDataTest.properties"), "127.0.0.1/1691"); // Homage to Empire
}
示例3: setUp
import org.snmp4j.mp.MPv3; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
// Create a global USM that all client calls will use
MPv3.setEnterpriseID(5813);
m_usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(m_usm);
m_agent = MockSnmpAgent.createAgentAndRun(classPathResource("brocadeTestData1.properties"), "127.0.0.1/1691"); // Homage to Empire
m_requestedVarbinds = new ArrayList<AnticipatedRequest>();
}
示例4: setUp
import org.snmp4j.mp.MPv3; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
// Create a global USM that all client calls will use
MPv3.setEnterpriseID(5813);
m_usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(m_usm);
m_agent = MockSnmpAgent.createAgentAndRun(classPathResource("loadSnmpDataTest.properties"), "127.0.0.1/1691"); // Homage to Empire
m_requestedVarbinds = new ArrayList<AnticipatedRequest>();
}
示例5: setUp
import org.snmp4j.mp.MPv3; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
// Create a global USM that all client calls will use
MPv3.setEnterpriseID(5813);
m_usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(m_usm);
m_agent = MockSnmpAgent.createAgentAndRun(classPathResource("penrose-lldp-mib.properties"), "127.0.0.1/1691");
m_requestedVarbinds = new ArrayList<AnticipatedRequest>();
}