BUG-1275: Expose XmlStreamUtils.writeValue()
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / repo / spi / SchemaSourceRegistry.java
1 /*
2  * Copyright (c) 2014 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/eplv10.html
7  */
8 package org.opendaylight.yangtools.yang.model.repo.spi;
9
10 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
11 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
12
13 /**
14  * Registry of all potentially available schema sources. Processes capable of
15  * dynamic schema discovery, such as OSGi registry scanners, NETCONF clients
16  * (with NETCONF monitoring extension) and similar can register
17  * {@link SchemaSourceProvider} instances which would then acquire the schema
18  * source.
19  */
20 public interface SchemaSourceRegistry {
21     /**
22      * Register a new schema source which is potentially available from a provider.
23      * A registration does not guarantee that a subsequent call to
24      * {@link SchemaSourceProvider#getSource(SourceIdentifier)} will succeed.
25      *
26      * @param identifier Schema source identifier
27      * @param provider Resolver which can potentially resolve the identifier
28      * @param representation Schema source representation which the source may
29      *                       be available.
30      * @return A registration handle. Invoking {@link SchemaSourceRegistration#close()}
31      *         will cancel the registration.
32      */
33     <T extends SchemaSourceRepresentation> SchemaSourceRegistration registerSchemaSource(
34             SourceIdentifier identifier, SchemaSourceProvider<? super T> provider, Class<T> representation);
35
36     /**
37      * Register a schema transformer. The registry can invoke it to transform between
38      * the various schema source formats.
39      *
40      * @param transformer Schema source transformer
41      * @return A registration handle. Invoking {@link SchemaTransformerRegistration#close()}
42      *         will cancel the registration.
43      */
44     SchemaTransformerRegistration registerSchemaSourceTransformer(SchemaSourceTransformer<?, ?> transformer);
45 }