11782fe2acbc58820883fb70f900c624acc41cf5
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / repo / api / SchemaContextFactory.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/epl-v10.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 import java.util.Collection;
13 import javax.annotation.Nonnull;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
15
16 /**
17  * An asynchronous factory for building {@link SchemaContext} instances
18  * based on a specification of what {@link SourceIdentifier}s are required
19  * and dynamic recursive resolution.
20  */
21 @Beta
22 public interface SchemaContextFactory {
23     /**
24      * Create a new schema context containing specified sources, pulling in
25      * any dependencies they may have.
26      *
27      * @param requiredSources a collection of sources which are required to
28      *                        be present
29      * @return A checked future, which will produce a schema context, or
30      *         fail with an explanation why the creation of the schema context
31      *         failed.
32      */
33     CheckedFuture<SchemaContext, SchemaResolutionException> createSchemaContext(@Nonnull Collection<SourceIdentifier> requiredSources);
34 }