X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-monitoring%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fmonitoring%2Fosgi%2FNetconfMonitoringActivator.java;h=1a0941085f92d892163a0926f4c85e4835b03084;hb=refs%2Fchanges%2F13%2F23413%2F26;hp=1b0a50b8304dbcd335eea01df0038737f46958af;hpb=b5e3b3f436f8534ddb6c7f326ccbef995b96ddc3;p=controller.git diff --git a/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivator.java b/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivator.java index 1b0a50b830..1a0941085f 100644 --- a/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivator.java +++ b/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivator.java @@ -1,24 +1,19 @@ /* -* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. -* -* This program and the accompanying materials are made available under the -* terms of the Eclipse Public License v1.0 which accompanies this distribution, -* and is available at http://www.eclipse.org/legal/epl-v10.html -*/ + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + package org.opendaylight.controller.netconf.monitoring.osgi; -import com.google.common.base.Optional; -import com.google.common.collect.Sets; -import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.Set; -import org.opendaylight.controller.netconf.api.Capability; +import org.opendaylight.controller.config.util.capability.Capability; import org.opendaylight.controller.netconf.api.monitoring.CapabilityListener; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; -import org.opendaylight.controller.netconf.monitoring.MonitoringConstants; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.slf4j.Logger; @@ -51,39 +46,6 @@ public class NetconfMonitoringActivator implements BundleActivator { private final NetconfMonitoringOperationService operationService; - private static final Set CAPABILITIES = Sets.newHashSet(new Capability() { - - @Override - public String getCapabilityUri() { - return MonitoringConstants.URI; - } - - @Override - public Optional getModuleNamespace() { - return Optional.of(MonitoringConstants.NAMESPACE); - } - - @Override - public Optional getModuleName() { - return Optional.of(MonitoringConstants.MODULE_NAME); - } - - @Override - public Optional getRevision() { - return Optional.of(MonitoringConstants.MODULE_REVISION); - } - - @Override - public Optional getCapabilitySchema() { - return Optional.absent(); - } - - @Override - public Collection getLocation() { - return Collections.emptyList(); - } - }); - private static final AutoCloseable AUTO_CLOSEABLE = new AutoCloseable() { @Override public void close() throws Exception { @@ -91,8 +53,6 @@ public class NetconfMonitoringActivator implements BundleActivator { } }; - private final List listeners = new ArrayList<>(); - public NetconfMonitoringOperationServiceFactory(final NetconfMonitoringOperationService operationService) { this.operationService = operationService; } @@ -104,21 +64,15 @@ public class NetconfMonitoringActivator implements BundleActivator { @Override public Set getCapabilities() { - return CAPABILITIES; + return Collections.emptySet(); } @Override public AutoCloseable registerCapabilityListener(final CapabilityListener listener) { - listener.onCapabilitiesAdded(getCapabilities()); - listeners.add(listener); return AUTO_CLOSEABLE; } @Override - public void close() { - for (final CapabilityListener listener : listeners) { - listener.onCapabilitiesRemoved(getCapabilities()); - } - } + public void close() {} } }