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.api;
10 import com.google.common.annotations.Beta;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
14 import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
15 import org.opendaylight.yangtools.yang.model.api.source.SourceRepresentation;
18 * Interface exposed by repository implementations. A schema repository is a logically centralized place for model
19 * storage and creation of {@link EffectiveModelContext} instances.
22 public interface SchemaRepository {
24 * Returns {@link EffectiveModelContextFactory} with supplied configuration.
26 * @param config configuration of schema context factory.
27 * @return schema context factory.
29 @NonNull EffectiveModelContextFactory createEffectiveModelContextFactory(
30 @NonNull SchemaContextFactoryConfiguration config);
33 * Returns {@link EffectiveModelContextFactory} with {@link SchemaContextFactoryConfiguration#getDefault()}.
35 * @return schema context factory.
37 default @NonNull EffectiveModelContextFactory createEffectiveModelContextFactory() {
38 return createEffectiveModelContextFactory(SchemaContextFactoryConfiguration.getDefault());
41 <T extends SourceRepresentation> @NonNull ListenableFuture<T> getSchemaSource(@NonNull SourceIdentifier id,
42 @NonNull Class<T> represetation);