Search in sources :

Example 41 with BridgeMacLink

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

the class BroadcastDomain method printTopologyBFT.

public static String printTopologyBFT(List<BridgeMacLink> bft) {
    StringBuffer strbfr = new StringBuffer();
    for (BridgeMacLink link : bft) {
        strbfr.append("nodeid:[");
        strbfr.append(link.getNode().getId());
        strbfr.append("]:");
        strbfr.append(link.getMacAddress());
        strbfr.append(":bridgeport:");
        strbfr.append(link.getBridgePort());
        strbfr.append("\n");
    }
    return strbfr.toString();
}
Also used : BridgeMacLink(org.opennms.netmgt.model.BridgeMacLink)

Example 42 with BridgeMacLink

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

the class EnhancedLinkdServiceImpl method store.

@Override
public void store(BroadcastDomain domain, Date now) {
    for (SharedSegment segment : domain.getTopology()) {
        for (BridgeBridgeLink link : segment.getBridgeBridgeLinks()) {
            link.setBridgeBridgeLinkLastPollTime(new Date());
            saveBridgeBridgeLink(link);
        }
        for (BridgeMacLink link : segment.getBridgeMacLinks()) {
            link.setBridgeMacLinkLastPollTime(new Date());
            saveBridgeMacLink(link);
        }
    }
    for (Integer nodeid : domain.getBridgeNodesOnDomain()) {
        m_bridgeMacLinkDao.deleteByNodeIdOlderThen(nodeid, now);
        m_bridgeMacLinkDao.flush();
        m_bridgeBridgeLinkDao.deleteByNodeIdOlderThen(nodeid, now);
        m_bridgeBridgeLinkDao.deleteByDesignatedNodeIdOlderThen(nodeid, now);
        m_bridgeBridgeLinkDao.flush();
    }
}
Also used : BridgeBridgeLink(org.opennms.netmgt.model.BridgeBridgeLink) SharedSegment(org.opennms.netmgt.model.topology.SharedSegment) BridgeMacLink(org.opennms.netmgt.model.BridgeMacLink) Date(java.util.Date)

Aggregations

BridgeMacLink (org.opennms.netmgt.model.BridgeMacLink)42 Test (org.junit.Test)15 OnmsNode (org.opennms.netmgt.model.OnmsNode)13 BridgeBridgeLink (org.opennms.netmgt.model.BridgeBridgeLink)12 SharedSegment (org.opennms.netmgt.model.topology.SharedSegment)10 ArrayList (java.util.ArrayList)9 HashSet (java.util.HashSet)9 BroadcastDomain (org.opennms.netmgt.model.topology.BroadcastDomain)9 JUnitSnmpAgents (org.opennms.core.test.snmp.annotations.JUnitSnmpAgents)8 HashMap (java.util.HashMap)7 Bridge (org.opennms.netmgt.model.topology.Bridge)6 List (java.util.List)4 Date (java.util.Date)3 NetworkBuilder (org.opennms.netmgt.model.NetworkBuilder)3 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)3 BridgePort (org.opennms.netmgt.model.topology.BridgePort)3 Nms10205bNetworkBuilder (org.opennms.netmgt.nb.Nms10205bNetworkBuilder)3 Nms17216NetworkBuilder (org.opennms.netmgt.nb.Nms17216NetworkBuilder)3 InetAddress (java.net.InetAddress)2 Set (java.util.Set)2