Search in sources :

Example 21 with Service

use of org.opennms.netmgt.config.poller.Service in project opennms by OpenNMS.

the class PollerConfigServlet method deleteThese.

/**
 * <p>deleteThese</p>
 *
 * @param deleteServices a {@link java.util.List} object.
 * @throws java.io.IOException if any.
 */
public void deleteThese(java.util.List<String> deleteServices) throws IOException {
    for (String svcname : deleteServices) {
        if (pkg != null) {
            Collection<Service> svcColl = pkg.getServices();
            if (svcColl != null) {
                for (Service svc : svcColl) {
                    if (svc != null) {
                        if (svc.getName().equals(svcname)) {
                            pkg.removeService(svc);
                            removeMonitor(svc.getName());
                            break;
                        }
                    }
                }
            }
        }
    }
}
Also used : Service(org.opennms.netmgt.config.poller.Service)

Example 22 with Service

use of org.opennms.netmgt.config.poller.Service in project opennms by OpenNMS.

the class PollerConfigServlet method initPollerServices.

/**
 * <p>initPollerServices</p>
 */
public void initPollerServices() {
    Collection<org.opennms.netmgt.config.poller.Package> packageColl = pollerConfig.getPackages();
    if (packageColl != null) {
        Iterator<org.opennms.netmgt.config.poller.Package> pkgiter = packageColl.iterator();
        if (pkgiter.hasNext()) {
            pkg = pkgiter.next();
            Collection<Service> svcColl = pkg.getServices();
            for (Service svcProp : svcColl) {
                pollerServices.put(svcProp.getName(), svcProp);
            }
        }
    }
}
Also used : Service(org.opennms.netmgt.config.poller.Service)

Aggregations

Service (org.opennms.netmgt.config.poller.Service)22 Package (org.opennms.netmgt.config.poller.Package)11 OnmsMonitoredService (org.opennms.netmgt.model.OnmsMonitoredService)6 Test (org.junit.Test)5 PollerConfig (org.opennms.netmgt.config.PollerConfig)5 Parameter (org.opennms.netmgt.config.poller.Parameter)5 PollStatus (org.opennms.netmgt.poller.PollStatus)5 File (java.io.File)4 Rrd (org.opennms.netmgt.config.poller.Rrd)4 Downtime (org.opennms.netmgt.config.poller.Downtime)3 Filter (org.opennms.netmgt.config.poller.Filter)3 OnmsNode (org.opennms.netmgt.model.OnmsNode)3 MonitoredService (org.opennms.netmgt.poller.MonitoredService)3 ServiceMonitor (org.opennms.netmgt.poller.ServiceMonitor)3 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 InetAddress (java.net.InetAddress)2 HashMap (java.util.HashMap)2 List (java.util.List)2 CompletableFuture (java.util.concurrent.CompletableFuture)2