Search in sources :

Example 1 with MockPathOutage

use of org.opennms.netmgt.mock.MockPathOutage in project opennms by OpenNMS.

the class MockDatabase method populate.

public void populate(MockNetwork network) {
    MockVisitor dbCreater = new MockVisitorAdapter() {

        @Override
        public void visitNode(MockNode node) {
            writeNode(node);
        }

        @Override
        public void visitInterface(MockInterface iface) {
            writeInterface(iface);
        }

        @Override
        public void visitService(MockService svc) {
            writeService(svc);
        }

        @Override
        public void visitPathOutage(MockPathOutage out) {
            writePathOutage(out);
        }
    };
    network.visit(dbCreater);
    getJdbcTemplate().queryForObject("SELECT setval('nodeNxtId', max(nodeid)) FROM node", Integer.class);
}
Also used : MockVisitorAdapter(org.opennms.netmgt.mock.MockVisitorAdapter) MockVisitor(org.opennms.netmgt.mock.MockVisitor) MockInterface(org.opennms.netmgt.mock.MockInterface) MockPathOutage(org.opennms.netmgt.mock.MockPathOutage) MockService(org.opennms.netmgt.mock.MockService) MockNode(org.opennms.netmgt.mock.MockNode)

Aggregations

MockInterface (org.opennms.netmgt.mock.MockInterface)1 MockNode (org.opennms.netmgt.mock.MockNode)1 MockPathOutage (org.opennms.netmgt.mock.MockPathOutage)1 MockService (org.opennms.netmgt.mock.MockService)1 MockVisitor (org.opennms.netmgt.mock.MockVisitor)1 MockVisitorAdapter (org.opennms.netmgt.mock.MockVisitorAdapter)1