Decouple config and netconf subsystems.
[controller.git] / opendaylight / netconf / netconf-monitoring / src / main / java / org / opendaylight / controller / netconf / monitoring / osgi / NetconfMonitoringActivator.java
index 1b0a50b8304dbcd335eea01df0038737f46958af..1a0941085f92d892163a0926f4c85e4835b03084 100644 (file)
@@ -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<Capability> CAPABILITIES = Sets.<Capability>newHashSet(new Capability() {
-
-            @Override
-            public String getCapabilityUri() {
-                return MonitoringConstants.URI;
-            }
-
-            @Override
-            public Optional<String> getModuleNamespace() {
-                return Optional.of(MonitoringConstants.NAMESPACE);
-            }
-
-            @Override
-            public Optional<String> getModuleName() {
-                return Optional.of(MonitoringConstants.MODULE_NAME);
-            }
-
-            @Override
-            public Optional<String> getRevision() {
-                return Optional.of(MonitoringConstants.MODULE_REVISION);
-            }
-
-            @Override
-            public Optional<String> getCapabilitySchema() {
-                return Optional.absent();
-            }
-
-            @Override
-            public Collection<String> 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<CapabilityListener> listeners = new ArrayList<>();
-
         public NetconfMonitoringOperationServiceFactory(final NetconfMonitoringOperationService operationService) {
             this.operationService = operationService;
         }
@@ -104,21 +64,15 @@ public class NetconfMonitoringActivator implements BundleActivator {
 
         @Override
         public Set<Capability> 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() {}
     }
 }