Search in sources :

Example 41 with NetworkBuilder

use of org.opennms.netmgt.model.NetworkBuilder in project opennms by OpenNMS.

the class Nms7918NetworkBuilder method buildNetwork7918.

public void buildNetwork7918() {
    NetworkBuilder nb = getNetworkBuilder();
    nb.addNode(PE01_NAME).setForeignSource("linkd").setForeignId(PE01_NAME).setSysObjectId(PE01_SYSOID).setType(NodeType.ACTIVE);
    nb.addInterface(PE01_IP).setIsSnmpPrimary("P").setIsManaged("M");
    m_nodeDao.save(nb.getCurrentNode());
    nb.addNode(ASW01_NAME).setForeignSource("linkd").setForeignId(ASW01_NAME).setSysObjectId(ASW01_SYSOID).setType(NodeType.ACTIVE);
    nb.addInterface(ASW01_IP).setIsSnmpPrimary("P").setIsManaged("M");
    m_nodeDao.save(nb.getCurrentNode());
    m_nodeDao.flush();
    nb.addNode(OSPESS01_NAME).setForeignSource("linkd").setForeignId(OSPESS01_NAME).setSysObjectId(OSPESS01_SYSOID).setType(NodeType.ACTIVE);
    nb.addInterface(OSPESS01_IP).setIsSnmpPrimary("P").setIsManaged("M");
    m_nodeDao.save(nb.getCurrentNode());
    m_nodeDao.flush();
    nb.addNode(OSPWL01_NAME).setForeignSource("linkd").setForeignId(OSPWL01_NAME).setSysObjectId(OSPWL01_SYSOID).setType(NodeType.ACTIVE);
    nb.addInterface(OSPWL01_IP).setIsSnmpPrimary("P").setIsManaged("M");
    m_nodeDao.save(nb.getCurrentNode());
    m_nodeDao.flush();
    nb.addNode(SAMASW01_NAME).setForeignSource("linkd").setForeignId(SAMASW01_NAME).setSysObjectId(SAMASW01_SYSOID).setType(NodeType.ACTIVE);
    nb.addInterface(SAMASW01_IP).setIsSnmpPrimary("P").setIsManaged("M");
    m_nodeDao.save(nb.getCurrentNode());
    m_nodeDao.flush();
    nb.addNode(STCASW01_NAME).setForeignSource("linkd").setForeignId(STCASW01_NAME).setSysObjectId(STCASW01_SYSOID).setType(NodeType.ACTIVE);
    nb.addInterface(STCASW01_IP).setIsSnmpPrimary("P").setIsManaged("M");
    m_nodeDao.save(nb.getCurrentNode());
    m_nodeDao.flush();
}
Also used : NetworkBuilder(org.opennms.netmgt.model.NetworkBuilder)

Example 42 with NetworkBuilder

use of org.opennms.netmgt.model.NetworkBuilder in project opennms by OpenNMS.

the class NmsNetworkBuilder method getNodeWithoutSnmp.

public OnmsNode getNodeWithoutSnmp(String name, String ipaddr) {
    NetworkBuilder nb = getNetworkBuilder();
    nb.addNode(name).setForeignSource("linkd").setForeignId(name).setType(NodeType.ACTIVE);
    nb.addInterface(ipaddr).setIsSnmpPrimary("N").setIsManaged("M");
    return nb.getCurrentNode();
}
Also used : NetworkBuilder(org.opennms.netmgt.model.NetworkBuilder)

Aggregations

NetworkBuilder (org.opennms.netmgt.model.NetworkBuilder)42 Before (org.junit.Before)20 OnmsNode (org.opennms.netmgt.model.OnmsNode)14 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)9 File (java.io.File)6 NCSBuilder (org.opennms.netmgt.model.ncs.NCSBuilder)5 Date (java.util.Date)4 Test (org.junit.Test)4 IpInterfaceDao (org.opennms.netmgt.dao.api.IpInterfaceDao)4 AdapterOperation (org.opennms.netmgt.provision.SimpleQueuedProvisioningAdapter.AdapterOperation)4 ArrayList (java.util.ArrayList)3 InterfaceBuilder (org.opennms.netmgt.model.NetworkBuilder.InterfaceBuilder)3 OnmsAccessPoint (org.opennms.netmgt.model.OnmsAccessPoint)3 OnmsServiceType (org.opennms.netmgt.model.OnmsServiceType)3 NCSComponent (org.opennms.netmgt.model.ncs.NCSComponent)3 UnknownHostException (java.net.UnknownHostException)2 HashMap (java.util.HashMap)2 MockPlatformTransactionManager (org.opennms.core.test.MockPlatformTransactionManager)2 ProxySnmpAgentConfigFactory (org.opennms.core.test.snmp.ProxySnmpAgentConfigFactory)2 InsufficientInformationException (org.opennms.core.utils.InsufficientInformationException)2