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


Java OnmsNode.setSysObjectId方法代码示例

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


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

示例1: setUp

import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
	// Use the mock.logLevel system property to control the log level
	MockLogAppender.setupLogging(true);

	// Set the operation delay to 1 second so that queued operations execute immediately
	m_adapter.setDelay(1);
	m_adapter.setTimeUnit(TimeUnit.SECONDS);

	Assert.notNull(m_nodeDao, "Autowiring failed, NodeDao is null");
	Assert.notNull(m_mockEventIpcManager, "Autowiring failed, IPC manager is null");
	Assert.notNull(m_populator, "Autowiring failed, DB populator is null");
	Assert.notNull(m_adapter, "Autowiring failed, adapter is null");

	// Make sure that the localhost SNMP connection config factory has overridden
	// the normal config factory
	assertTrue(m_adapter.getSnmpPeerFactory() instanceof ProxySnmpAgentConfigFactory);

	m_populator.populateDatabase();

	OnmsNode node = m_nodeDao.get(NODE_ID);
	assertNotNull(node);
	node.setSysObjectId(".1.3");
	m_nodeDao.saveOrUpdate(node);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:26,代码来源:SnmpAssetProvisioningAdapterIntegrationTest.java

示例2: doPersist

import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
/**
 * <p>doPersist</p>
 *
 * @return a {@link java.util.List} object.
 */
public List<Event> doPersist() {
	OnmsNode imported = getNode();
	OnmsNode db = getNodeDao().getHierarchy(imported.getId());

	List<Event> events = new LinkedList<Event>();

	// verify that the node label is still the same
	if (!db.getLabel().equals(imported.getLabel())) {
		db.setLabel(imported.getLabel());
		// TODO: nodeLabelChanged event
	}

       if (!nullSafeEquals(db.getForeignSource(), imported.getForeignSource())) {
           db.setForeignSource(imported.getForeignSource());
       }

       if (!nullSafeEquals(db.getForeignId(), imported.getForeignId())) {
           db.setForeignId(imported.getForeignId());
       }

       if (isSnmpDataForNodeUpToDate()) {

		if (!nullSafeEquals(db.getSysContact(), imported.getSysContact())) {
			db.setSysContact(imported.getSysContact());
		}

		if (!nullSafeEquals(db.getSysDescription(), imported.getSysDescription())) {
			db.setSysDescription(imported.getSysDescription());
		}

		if (!nullSafeEquals(db.getSysLocation(), imported.getSysLocation())) {
			db.setSysLocation(imported.getSysLocation());
		}

		if (!nullSafeEquals(db.getSysName(), imported.getSysName())) {
			db.setSysName(imported.getSysName());
		}

		if (!nullSafeEquals(db.getSysObjectId(), imported.getSysObjectId())) {
			db.setSysObjectId(imported.getSysObjectId());
		}
		
	}

       if (isSnmpDataForInterfacesUpToDate())
           updateSnmpInterfaces(db, imported);

       updateInterfaces(db, imported, events);
	updateCategories(db, imported);

	getNodeDao().update(db);
       
	return events;

}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:61,代码来源:UpdateOperation.java

示例3: createAgent

import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
protected void createAgent(int ifIndex, PrimaryType ifCollType) {
    m_node = new OnmsNode();
    m_node.setSysObjectId(".1.2.3.4.5.6.7");
    
    OnmsSnmpInterface snmpIface = new OnmsSnmpInterface(m_node, ifIndex);

	m_iface = new OnmsIpInterface();
    m_iface.setId(123);
    m_iface.setIpAddress(myLocalHost());
	m_iface.setIsSnmpPrimary(ifCollType);
	m_iface.setSnmpInterface(snmpIface);
	m_node.addIpInterface(m_iface);
    

	EasyMock.expect(m_ifaceDao.load(m_iface.getId())).andReturn(m_iface).anyTimes();
    
    m_easyMockUtils.replayAll();
    
    m_agent = DefaultCollectionAgent.create(m_iface.getId(), m_ifaceDao, new MockPlatformTransactionManager());
    
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:22,代码来源:SnmpCollectorTestCase.java


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