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 static java.util.Objects.requireNonNull;
12 import com.google.common.collect.ClassToInstanceMap;
13 import com.google.common.collect.ImmutableClassToInstanceMap;
14 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
15 import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension;
16 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
17 import org.opendaylight.yangtools.concepts.ListenerRegistration;
18 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
19 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
21 final class SchemaServiceStub implements DOMSchemaService {
22 private final EffectiveModelContext schemaContext;
24 SchemaServiceStub(final EffectiveModelContext schemaContext) {
25 this.schemaContext = requireNonNull(schemaContext);
29 public EffectiveModelContext getGlobalContext() {
34 public ListenerRegistration<EffectiveModelContextListener> registerSchemaContextListener(
35 final EffectiveModelContextListener listener) {
36 listener.onModelContextUpdated(schemaContext);
37 return new AbstractListenerRegistration<>(listener) {
39 protected void removeRegistration() {
46 public ClassToInstanceMap<DOMSchemaServiceExtension> getExtensions() {
47 return ImmutableClassToInstanceMap.of();