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


Java MPv3.setEnterpriseID方法代码示例

本文整理汇总了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;
    }
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:27,代码来源:Snmp4JStrategy.java

示例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
}
 
开发者ID:vishwaabhinav,项目名称:OpenNMS,代码行数:17,代码来源:MockSnmpAgentTest.java

示例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>();
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:12,代码来源:BrocadeMibTest.java

示例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>();
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:12,代码来源:MockSnmpAgentTest.java

示例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>();
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:12,代码来源:LLDPMibTest.java


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