本文整理汇总了Java中org.opennms.netmgt.model.OnmsNode.setId方法的典型用法代码示例。如果您正苦于以下问题:Java OnmsNode.setId方法的具体用法?Java OnmsNode.setId怎么用?Java OnmsNode.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opennms.netmgt.model.OnmsNode
的用法示例。
在下文中一共展示了OnmsNode.setId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNode
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private OnmsNode createNode(int nodeId, String nodelabel, String foreignSource, String foreignId, String ipAddress) {
OnmsNode n = new OnmsNode();
n.setId(nodeId);
n.setLabel(nodelabel);
if (foreignSource != null) {
n.setForeignSource(foreignSource);
}
if (foreignId != null) {
n.setForeignId(foreignId);
}
OnmsIpInterface ip = new OnmsIpInterface();
ip.setId(10 + nodeId);
ip.setIpAddress(InetAddressUtils.addr(ipAddress));
ip.setNode(n);
n.addIpInterface(ip);
return n;
}
示例2: setUp
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
MockUtil.println("------------ Begin Test " + m_testName.getMethodName() + " --------------------------");
MockLogAppender.setupLogging();
m_fileAnticipator = new FileAnticipator();
m_intf = new OnmsIpInterface();
m_node = new OnmsNode();
m_node.setId(1);
m_intf.setId(25);
m_intf.setNode(m_node);
m_intf.setIpAddress(InetAddressUtils.addr("1.1.1.1"));
m_ifDao = m_easyMockUtils.createMock(IpInterfaceDao.class);
m_serviceParams = new ServiceParameters(new HashMap<String,Object>());
}
示例3: testEventsForNodeId
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
@Test
public void testEventsForNodeId() throws Exception {
OnmsNode node = new OnmsNode();
node.setId(1);
OnmsEvent event = new OnmsEvent();
event.setDistPoller(m_distPollerDao.get("localhost"));
event.setEventUei("uei.opennms.org/test");
event.setEventTime(new Date());
event.setEventSource("test");
event.setEventCreateTime(new Date());
event.setEventSeverity(1);
event.setEventLog("Y");
event.setEventDisplay("Y");
event.setNode(node);
m_eventDao.save(event);
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("limit", "50");
parameters.put("node.id", "1");
String xml = sendRequest(GET, "/events", parameters, 200);
assertTrue(xml.contains("totalCount=\"1\""));
assertTrue(xml.contains("uei.opennms.org/test"));
}
示例4: setUp
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
MockLogAppender.setupLogging();
m_fileAnticipator = new FileAnticipator();
m_intf = new OnmsIpInterface();
m_node = new OnmsNode();
m_node.setId(1);
m_intf.setNode(m_node);
m_intf.setIpAddress(InetAddressUtils.addr("1.1.1.1"));
m_intf.setId(27);
m_ifDao = EasyMock.createMock(IpInterfaceDao.class);
EasyMock.expect(m_ifDao.load(m_intf.getId())).andReturn(m_intf).anyTimes();
EasyMock.replay(m_ifDao);
}
示例5: getMonitoredService
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private OnmsMonitoredService getMonitoredService() {
OnmsNode node = new OnmsNode();
node.setId(1);
OnmsIpInterface iface = new OnmsIpInterface("192.168.1.1", node);
OnmsServiceType svcType = new OnmsServiceType("HTTP");
OnmsMonitoredService svc = new OnmsMonitoredService(iface, svcType);
return svc;
}
示例6: load
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
@Override
public OnmsNode load(Integer id) {
OnmsNode node = new OnmsNode();
node.setId(777);
node.setLabel("p-brane");
return node;
}
示例7: testFilteredResourceAttributeFilteringWithMatch
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
public void testFilteredResourceAttributeFilteringWithMatch() throws Exception {
OnmsAttribute rrdAttribute = new RrdGraphAttribute("IfInOctets", "something", "something else");
ExternalValueAttribute externalValueAttribute = new ExternalValueAttribute("ifSpeed", "100000000");
Set<OnmsAttribute> attributes = new HashSet<OnmsAttribute>();
attributes.add(rrdAttribute);
attributes.add(externalValueAttribute);
final OnmsNode node = new OnmsNode();
node.setId(1);
node.setLabel("Node One");
EasyMock.expect(m_nodeDao.load(1)).andReturn(node);
MockResourceType resourceType = new MockResourceType();
resourceType.setName("interfaceSnmp");
OnmsResource resource = new OnmsResource(node.getId().toString(), node.getLabel(), resourceType, attributes);
ReportDefinition def = createReportDefinition();
def.getReport().getPackage().setFilter("");
def.setResourceAttributeKey(externalValueAttribute.getName());
def.setResourceAttributeValueMatch(externalValueAttribute.getValue());
ReportInstance report = def.createReport(m_nodeDao, m_resourceDao, m_rrdDao, m_filterDao);
SortedMap<Integer,String> sortedNodeMap = new TreeMap<Integer, String>();
sortedNodeMap.put(node.getId(), node.getLabel());
EasyMock.expect(m_filterDao.getNodeMap("")).andReturn(sortedNodeMap);
EasyMock.expect(m_resourceDao.getResourceForNode(node)).andReturn(resource);
EasyMock.expect(m_rrdDao.getPrintValue(rrdAttribute, def.getConsolidationFunction(), report.getStartTime(), report.getEndTime())).andReturn(1.0);
m_mocks.replayAll();
report.walk();
assertEquals("results size", 1, report.getResults().size());
}
示例8: findAll
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
@Override
public List<OnmsNode> findAll() {
List<OnmsNode> nodeList = new LinkedList<OnmsNode>();
OnmsNode node = new OnmsNode();
node.setId(777);
node.setLabel("p-brane");
nodeList.add(node);
return nodeList;
}
示例9: createSnmpIfData
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private static SnmpIfData createSnmpIfData(String ipAddress, String ifName, Long ifSpeed, Integer ifIndex, boolean collectionEnabled) {
OnmsNode node = new OnmsNode();
node.setId(1);
node.setLabel("testNode");
OnmsSnmpInterface snmpIface = new OnmsSnmpInterface(node, ifIndex);
snmpIface.setIfDescr(ifName);
snmpIface.setIfName(ifName);
snmpIface.setIfAlias(ifName);
snmpIface.setIfSpeed(ifSpeed);
// If the SNMP interface doesn't have collection enable, threshold processing will be ignored for the interface
snmpIface.setCollectionEnabled(collectionEnabled);
return new SnmpIfData(snmpIface);
}
示例10: createNode
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private OnmsNode createNode(int id, String label) {
OnmsNode node = new OnmsNode();
node.setId(id);
node.setLabel(label);
return node;
}
示例11: setNode8
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private void setNode8(final OnmsNode node8) {
node8.setId(8);
m_node8 = node8;
}
示例12: setNode3
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private void setNode3(final OnmsNode node3) {
node3.setId(3);
m_node3 = node3;
}
示例13: setNode4
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private void setNode4(final OnmsNode node4) {
node4.setId(4);
m_node4 = node4;
}
示例14: setNode5
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private void setNode5(final OnmsNode node5) {
node5.setId(5);
m_node5 = node5;
}
示例15: setNode7
import org.opennms.netmgt.model.OnmsNode; //导入方法依赖的package包/类
private void setNode7(final OnmsNode node7) {
node7.setId(7);
m_node7 = node7;
}