2 * Copyright (c) 2014 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/eplv10.html
8 package org.opendaylight.yangtools.yang.model.repo.spi;
10 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
11 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
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
20 public interface SchemaSourceRegistry {
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.
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
30 * @return A registration handle. Invoking {@link SchemaSourceRegistration#close()}
31 * will cancel the registration.
33 <T extends SchemaSourceRepresentation> SchemaSourceRegistration registerSchemaSource(
34 SourceIdentifier identifier, SchemaSourceProvider<? super T> provider, Class<T> representation);
37 * Register a schema transformer. The registry can invoke it to transform between
38 * the various schema source formats.
40 * @param transformer Schema source transformer
41 * @return A registration handle. Invoking {@link SchemaTransformerRegistration#close()}
42 * will cancel the registration.
44 SchemaTransformerRegistration registerSchemaSourceTransformer(SchemaSourceTransformer<?, ?> transformer);