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/epl-v10.html
8 package org.opendaylight.yangtools.yang.model.repo.spi;
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
12 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
15 * Registry of all potentially available schema sources. Processes capable of
16 * dynamic schema discovery, such as OSGi registry scanners, NETCONF clients
17 * (with NETCONF monitoring extension) and similar can register
18 * {@link SchemaSourceProvider} instances which would then acquire the schema
22 public interface SchemaSourceRegistry {
24 * Register a new schema source which is potentially available from a provider.
25 * A registration does not guarantee that a subsequent call to
26 * {@link SchemaSourceProvider#getSource(SourceIdentifier)} will succeed.
28 * @param provider Resolver which can potentially resolve the identifier
29 * @param source Schema source details
30 * @return A registration handle. Invoking {@link SchemaSourceRegistration#close()}
31 * will cancel the registration.
33 <T extends SchemaSourceRepresentation> SchemaSourceRegistration<T> registerSchemaSource(SchemaSourceProvider<? super T> provider, PotentialSchemaSource<T> source);
36 * Register a schema source listener. The listener will be notified as new
37 * sources and their representations become available, subject to the provided
40 * @param listener Schema source listener
41 * @return A registration handle. Invoking {@link SchemaListenerRegistration#close()}
42 * will cancel the registration.
44 SchemaListenerRegistration registerSchemaSourceListener(SchemaSourceListener listener);