2 * Copyright (c) 2013 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.mdsal.dom.api;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.function.Consumer;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.concepts.Registration;
14 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
15 import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
16 import org.opendaylight.yangtools.yang.model.api.source.YangTextSource;
19 public interface DOMSchemaService extends DOMService<DOMSchemaService, DOMSchemaService.Extension> {
21 * Type capture of a {@link DOMService.Extension} applicable to {@link DOMSchemaService} implementations.
23 interface Extension extends DOMService.Extension<DOMSchemaService, Extension> {
28 * Returns global schema context.
30 * @return schemaContext
32 EffectiveModelContext getGlobalContext();
35 * Register a listener for changes in schema context.
37 * @param listener Listener which should be registered
38 * @return Listener registration handle
39 * @throws NullPointerException if {@code listener} is {@code null}
41 Registration registerSchemaContextListener(Consumer<EffectiveModelContext> listener);
44 * An {@link Extension} exposing access to {@link YangTextSource}.
47 interface YangTextSourceExtension extends Extension {
49 * Return a future producing a {@link YangTextSource} containing the YANG text of specified source.
51 * @param sourceId A {@link SourceIdentifier}
54 ListenableFuture<YangTextSource> getYangTexttSource(SourceIdentifier sourceId);