Eliminate use of SchemaService
[netconf.git] / netconf / mdsal-netconf-connector / src / test / java / org / opendaylight / netconf / mdsal / connector / ops / SchemaServiceStub.java
index 206beab647cf16e99dd4f449a13bac6b274ab10f..e1780478f18313a1a7d93e402f4f9bbd627ee555 100644 (file)
@@ -5,31 +5,21 @@
  * 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.netconf.mdsal.connector.ops;
 
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 
-final class SchemaServiceStub implements SchemaService {
+final class SchemaServiceStub implements DOMSchemaService {
     private final SchemaContext schemaContext;
 
     SchemaServiceStub(SchemaContext schemaContext) {
         this.schemaContext = schemaContext;
     }
 
-    @Override
-    public void addModule(final Module module) {
-    }
-
-    @Override
-    public void removeModule(final Module module) {
-
-    }
-
     @Override
     public SchemaContext getSessionContext() {
         return schemaContext;
@@ -44,14 +34,10 @@ final class SchemaServiceStub implements SchemaService {
     public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
         final SchemaContextListener listener) {
         listener.onGlobalContextUpdated(getGlobalContext());
-        return new ListenerRegistration<SchemaContextListener>() {
-            @Override
-            public void close() {
-            }
-
+        return new AbstractListenerRegistration<SchemaContextListener>(listener) {
             @Override
-            public SchemaContextListener getInstance() {
-                return listener;
+            protected void removeRegistration() {
+                // No-op
             }
         };
     }