@Test(timeout=300000) @JUnitTemporaryDatabase @JUnitSnmpAgents({ @JUnitSnmpAgent(host="10.1.15.245", resource="classpath:snmpwalk-demo.properties"), @JUnitSnmpAgent(host="10.3.20.23", resource="classpath:snmpwalk-demo.properties"), @JUnitSnmpAgent(host="2001:0470:e2f1:cafe:16c1:7cff:12d6:7bb9", resource="classpath:snmpwalk-demo.properties") }) @Transactional public void testPopulateWithIpv6OnlySnmpAndNodeScan() throws Exception { importFromResource("classpath:/requisition_then_scanv6only.xml", true); assertEquals(1, getDistPollerDao().countAll()); assertEquals(1, getNodeDao().countAll()); assertEquals(1, getInterfaceDao().countAll()); assertEquals(1, getMonitoredServiceDao().countAll()); assertEquals(1, getServiceTypeDao().countAll()); assertEquals(1, getSnmpInterfaceDao().countAll()); final List<OnmsNode> nodes = getNodeDao().findAll(); final OnmsNode node = nodes.get(0); final NodeScan scan = m_provisioner.createNodeScan(node.getId(), node.getForeignSource(), node.getForeignId()); runScan(scan); assertEquals(1, getDistPollerDao().countAll()); assertEquals(1, getNodeDao().countAll()); assertEquals("Unexpected number of IP interfaces found: " + getInterfaceDao().findAll(), 3, getInterfaceDao().countAll()); assertEquals("Unexpected number of services found: "+getMonitoredServiceDao().findAll(), 3, getMonitoredServiceDao().countAll()); assertEquals("Unexpected number of service types found: " + getServiceTypeDao().findAll(), 1, getServiceTypeDao().countAll()); assertEquals("Unexpected number of SNMP interfaces found: " + getSnmpInterfaceDao().findAll(), 6, getSnmpInterfaceDao().countAll()); }
public NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId) { log().info("createNodeScan called"); return new NodeScan(nodeId, foreignSource, foreignId, m_provisionService, m_eventForwarder, m_agentConfigFactory, m_taskCoordinator); }
Provisioner implements SpringServiceDaemon { public NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId) { log().info("createNodeScan called"); return new NodeScan(nodeId, foreignSource, foreignId, m_provisionService, m_eventForwarder, m_agentConfigFactory, m_taskCoordinator); } }
Provisioner implements SpringServiceDaemon { public NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId) { log().info("createNodeScan called"); return new NodeScan(nodeId, foreignSource, foreignId, m_provisionService, m_eventForwarder, m_agentConfigFactory, m_taskCoordinator); }  }
Provisioner implements SpringServiceDaemon { public NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId) { log().info("createNodeScan called"); return new NodeScan(nodeId, foreignSource, foreignId, m_provisionService, m_eventForwarder, m_agentConfigFactory, m_taskCoordinator); }  void setProvisionService(ProvisionService provisionService); ProvisionService getProvisionService(); void setScheduledExecutor(ScheduledExecutorService scheduledExecutor); void setLifeCycleRepository(LifeCycleRepository lifeCycleRepository); void setImportSchedule(ImportScheduler schedule); void setImportActivities(CoreImportActivities importActivities); void setTaskCoordinator(DefaultTaskCoordinator taskCoordinator); void setAgentConfigFactory(SnmpAgentConfigFactory agentConfigFactory); ImportScheduler getImportSchedule(); @Override void start(); @Override void destroy(); @Override void afterPropertiesSet(); void doNodeScan(int nodeId); NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId); NewSuspectScan createNewSuspectScan(InetAddress ipAddress); ScheduledFuture<?> getScheduledFutureForNode(int nodeId); int getScheduleLength(); ThreadCategory log(); void setEventForwarder(EventForwarder eventForwarder); EventForwarder getEventForwarder(); void doImport(); @EventHandler(uei = EventConstants.RELOAD_IMPORT_UEI) void doImport(final Event event); void doImport(final String url, final boolean rescanExisting); @EventHandler(uei = EventConstants.NODE_ADDED_EVENT_UEI) void handleNodeAddedEvent(Event e); @EventHandler(uei = EventConstants.FORCE_RESCAN_EVENT_UEI) void handleForceRescan(Event e); @EventHandler(uei = EventConstants.NEW_SUSPECT_INTERFACE_EVENT_UEI) void handleNewSuspectEvent(Event e); @EventHandler(uei = EventConstants.NODE_UPDATED_EVENT_UEI) void handleNodeUpdated(Event e); @EventHandler(uei = EventConstants.NODE_DELETED_EVENT_UEI) void handleNodeDeletedEvent(Event e); @EventHandler(uei = EventConstants.RELOAD_DAEMON_CONFIG_UEI) void handleReloadConfigEvent(Event e); @EventHandler(uei=EventConstants.ADD_INTERFACE_EVENT_UEI) void handleAddInterface(Event event); @EventHandler(uei=EventConstants.ADD_NODE_EVENT_UEI) void handleAddNode(Event event); @EventHandler(uei=EventConstants.CHANGE_SERVICE_EVENT_UEI) void handleChangeService(Event event); @EventHandler(uei=EventConstants.DELETE_INTERFACE_EVENT_UEI) void handleDeleteInterface(Event event); @EventHandler(uei=EventConstants.DELETE_NODE_EVENT_UEI) void handleDeleteNode(Event event); @EventHandler(uei=EventConstants.DELETE_SERVICE_EVENT_UEI) void handleDeleteService(Event event); @EventHandler(uei=EventConstants.UPDATE_SERVER_EVENT_UEI) void handleUpdateServer(Event event); @EventHandler(uei=EventConstants.UPDATE_SERVICE_EVENT_UEI) void handleUpdateService(Event event); String getStats(); }
Provisioner implements SpringServiceDaemon { public NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId) { log().info("createNodeScan called"); return new NodeScan(nodeId, foreignSource, foreignId, m_provisionService, m_eventForwarder, m_agentConfigFactory, m_taskCoordinator); }  void setProvisionService(ProvisionService provisionService); ProvisionService getProvisionService(); void setScheduledExecutor(ScheduledExecutorService scheduledExecutor); void setLifeCycleRepository(LifeCycleRepository lifeCycleRepository); void setImportSchedule(ImportScheduler schedule); void setImportActivities(CoreImportActivities importActivities); void setTaskCoordinator(DefaultTaskCoordinator taskCoordinator); void setAgentConfigFactory(SnmpAgentConfigFactory agentConfigFactory); ImportScheduler getImportSchedule(); @Override void start(); @Override void destroy(); @Override void afterPropertiesSet(); void doNodeScan(int nodeId); NodeScan createNodeScan(Integer nodeId, String foreignSource, String foreignId); NewSuspectScan createNewSuspectScan(InetAddress ipAddress); ScheduledFuture<?> getScheduledFutureForNode(int nodeId); int getScheduleLength(); ThreadCategory log(); void setEventForwarder(EventForwarder eventForwarder); EventForwarder getEventForwarder(); void doImport(); @EventHandler(uei = EventConstants.RELOAD_IMPORT_UEI) void doImport(final Event event); void doImport(final String url, final boolean rescanExisting); @EventHandler(uei = EventConstants.NODE_ADDED_EVENT_UEI) void handleNodeAddedEvent(Event e); @EventHandler(uei = EventConstants.FORCE_RESCAN_EVENT_UEI) void handleForceRescan(Event e); @EventHandler(uei = EventConstants.NEW_SUSPECT_INTERFACE_EVENT_UEI) void handleNewSuspectEvent(Event e); @EventHandler(uei = EventConstants.NODE_UPDATED_EVENT_UEI) void handleNodeUpdated(Event e); @EventHandler(uei = EventConstants.NODE_DELETED_EVENT_UEI) void handleNodeDeletedEvent(Event e); @EventHandler(uei = EventConstants.RELOAD_DAEMON_CONFIG_UEI) void handleReloadConfigEvent(Event e); @EventHandler(uei=EventConstants.ADD_INTERFACE_EVENT_UEI) void handleAddInterface(Event event); @EventHandler(uei=EventConstants.ADD_NODE_EVENT_UEI) void handleAddNode(Event event); @EventHandler(uei=EventConstants.CHANGE_SERVICE_EVENT_UEI) void handleChangeService(Event event); @EventHandler(uei=EventConstants.DELETE_INTERFACE_EVENT_UEI) void handleDeleteInterface(Event event); @EventHandler(uei=EventConstants.DELETE_NODE_EVENT_UEI) void handleDeleteNode(Event event); @EventHandler(uei=EventConstants.DELETE_SERVICE_EVENT_UEI) void handleDeleteService(Event event); @EventHandler(uei=EventConstants.UPDATE_SERVER_EVENT_UEI) void handleUpdateServer(Event event); @EventHandler(uei=EventConstants.UPDATE_SERVICE_EVENT_UEI) void handleUpdateService(Event event); String getStats(); static final String NAME; }