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.concepts.Registration;
12 import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
13 import org.opendaylight.yangtools.yang.model.api.source.SourceRepresentation;
16 * Registry of all potentially available schema sources. Processes capable of dynamic schema discovery, such as OSGi
17 * registry scanners, NETCONF clients (with NETCONF monitoring extension) and similar can register
18 * {@link SchemaSourceProvider} instances which would then acquire the schema source.
21 public interface SchemaSourceRegistry {
23 * Register a new schema source which is potentially available from a provider. A registration does not guarantee
24 * that a subsequent call to {@link SchemaSourceProvider#getSource(SourceIdentifier)} will succeed.
26 * @param <T> schema source representation type
27 * @param provider Resolver which can potentially resolve the identifier
28 * @param source Schema source details
29 * @return A registration handle. Invoking {@link Registration#close()} will cancel the registration.
31 <T extends SourceRepresentation> Registration registerSchemaSource(SchemaSourceProvider<? super T> provider,
32 PotentialSchemaSource<T> source);
35 * Register a schema source listener. The listener will be notified as new sources and their representations become
36 * available, subject to the provided filter.
38 * @param listener Schema source listener
39 * @return A registration handle. Invoking {@link Registration#close()} will cancel the registration.
41 Registration registerSchemaSourceListener(SchemaSourceListener listener);