BUG-997: Evolve the SchemaRegistry concepts
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / repo / api / SchemaRepository.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.api;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.util.concurrent.CheckedFuture;
12
13 import javax.annotation.Nonnull;
14
15 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
16
17 /**
18  * Interface exposed by repository implementations. A schema repository is a logically
19  * centralized place for model storage and creation of {@link SchemaContext} instances.
20  */
21 @Beta
22 public interface SchemaRepository {
23     /**
24      * Instantiate a new {@link SchemaContextFactory}, which will filter available schema
25      * sources using the provided filter.
26      *
27      * @param filter Filter which acts as the gating function before a schema source is
28      *               considered by the factory for inclusion in the {@link SchemaContext}
29      *               it produces.
30      * @return A new schema context factory.
31      */
32     SchemaContextFactory createSchemaContextFactory(@Nonnull SchemaSourceFilter filter);
33
34     <T extends SchemaSourceRepresentation> CheckedFuture<T, SchemaSourceException> getSchemaSource(@Nonnull SourceIdentifier id, @Nonnull Class<T> represetation);
35 }