8770f96f204975a2227262285348876866875970
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMSchemaService.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.dom.api;
9
10 import java.util.function.Consumer;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.yangtools.concepts.Registration;
13 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
14
15 @NonNullByDefault
16 public interface DOMSchemaService extends DOMService<DOMSchemaService, DOMSchemaService.Extension> {
17     /**
18      * Type capture of a {@link DOMService.Extension} applicable to {@link DOMSchemaService} implementations.
19      */
20     interface Extension extends DOMService.Extension<DOMSchemaService, Extension> {
21         // Marker interface
22     }
23
24     /**
25      * Returns global schema context.
26      *
27      * @return schemaContext
28      */
29     EffectiveModelContext getGlobalContext();
30
31     /**
32      * Register a listener for changes in schema context.
33      *
34      * @param listener Listener which should be registered
35      * @return Listener registration handle
36      * @throws NullPointerException if {@code listener} is {@code null}
37      */
38     Registration registerSchemaContextListener(Consumer<EffectiveModelContext> listener);
39 }