2 * Copyright (c) 2018 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netconf.mdsal.connector.ops;
10 import com.google.common.collect.ClassToInstanceMap;
11 import com.google.common.collect.ImmutableClassToInstanceMap;
12 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
13 import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension;
14 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
15 import org.opendaylight.yangtools.concepts.ListenerRegistration;
16 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
17 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
19 final class SchemaServiceStub implements DOMSchemaService {
20 private final SchemaContext schemaContext;
22 SchemaServiceStub(SchemaContext schemaContext) {
23 this.schemaContext = schemaContext;
27 public SchemaContext getSessionContext() {
32 public SchemaContext getGlobalContext() {
37 public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
38 final SchemaContextListener listener) {
39 listener.onGlobalContextUpdated(getGlobalContext());
40 return new AbstractListenerRegistration<SchemaContextListener>(listener) {
42 protected void removeRegistration() {
49 public ClassToInstanceMap<DOMSchemaServiceExtension> getExtensions() {
50 return ImmutableClassToInstanceMap.of();