From 0b9b2c83928157411f59321abca139b12bd5e637 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sat, 3 Oct 2020 12:26:26 +0200 Subject: [PATCH] Remove SchemaContextFactory This has been superseded by EffectiveModelContextFactory three releases ago, remove it now. Change-Id: I0d0a2866fcb27694ec249a53ff44c6f6f981f76c Signed-off-by: Robert Varga --- .../api/EffectiveModelContextFactory.java | 16 +------- .../model/repo/api/SchemaContextFactory.java | 40 ------------------- .../yang/model/export/SimpleModuleTest.java | 4 +- 3 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaContextFactory.java diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/EffectiveModelContextFactory.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/EffectiveModelContextFactory.java index 4bbc88671d..7292b6e186 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/EffectiveModelContextFactory.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/EffectiveModelContextFactory.java @@ -8,22 +8,18 @@ package org.opendaylight.yangtools.yang.model.repo.api; import com.google.common.annotations.Beta; -import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.MoreExecutors; import java.util.Arrays; import java.util.Collection; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; /** - * An asynchronous factory for building {@link SchemaContext} instances based on a specification of what + * An asynchronous factory for building {@link EffectiveModelContext} instances based on a specification of what * {@link SourceIdentifier}s are required and dynamic recursive resolution. */ @Beta -// FIXME: 6.0.0: evaluate if we still need to extend SchemaContext here -public interface EffectiveModelContextFactory extends SchemaContextFactory { +public interface EffectiveModelContextFactory { /** * Create a new schema context containing specified sources, pulling in any dependencies they may have. * @@ -38,12 +34,4 @@ public interface EffectiveModelContextFactory extends SchemaContextFactory { final SourceIdentifier... requiredSources) { return createEffectiveModelContext(Arrays.asList(requiredSources)); } - - @Override - @Deprecated - default ListenableFuture createSchemaContext( - final Collection requiredSources) { - return Futures.transform(createEffectiveModelContext(requiredSources), ctx -> ctx, - MoreExecutors.directExecutor()); - } } diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaContextFactory.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaContextFactory.java deleted file mode 100644 index 8bb15c49ee..0000000000 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaContextFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yangtools.yang.model.repo.api; - -import com.google.common.annotations.Beta; -import com.google.common.util.concurrent.ListenableFuture; -import java.util.Arrays; -import java.util.Collection; -import org.eclipse.jdt.annotation.NonNull; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; - -/** - * An asynchronous factory for building {@link SchemaContext} instances based on a specification of what - * {@link SourceIdentifier}s are required and dynamic recursive resolution. - * - * @deprecated Use {@link EffectiveModelContextFactory} instead. - */ -@Beta -@Deprecated -public interface SchemaContextFactory { - /** - * Create a new schema context containing specified sources, pulling in any dependencies they may have. - * - * @param requiredSources a collection of sources which are required to be present - * @return A checked future, which will produce a schema context, or fail with an explanation why the creation - * of the schema context failed. - */ - @NonNull ListenableFuture createSchemaContext( - @NonNull Collection requiredSources); - - default @NonNull ListenableFuture createSchemaContext( - final SourceIdentifier... requiredSources) { - return createSchemaContext(Arrays.asList(requiredSources)); - } -} diff --git a/yang/yang-model-export/src/test/java/org/opendaylight/yangtools/yang/model/export/SimpleModuleTest.java b/yang/yang-model-export/src/test/java/org/opendaylight/yangtools/yang/model/export/SimpleModuleTest.java index 6c3cfbc335..e4aa534c71 100644 --- a/yang/yang-model-export/src/test/java/org/opendaylight/yangtools/yang/model/export/SimpleModuleTest.java +++ b/yang/yang-model-export/src/test/java/org/opendaylight/yangtools/yang/model/export/SimpleModuleTest.java @@ -15,8 +15,8 @@ import java.util.HashSet; import java.util.Set; import org.junit.Before; import org.junit.Test; +import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.api.Module; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory; import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation; import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier; @@ -67,7 +67,7 @@ public class SimpleModuleTest { } private void testSetOfModules(final Collection source) throws Exception { - final SchemaContext schemaContext = schemaContextFactory.createSchemaContext(source).get(); + final EffectiveModelContext schemaContext = schemaContextFactory.createEffectiveModelContext(source).get(); final File outDir = new File("target/collection"); outDir.mkdirs(); for (final Module module : schemaContext.getModules()) { -- 2.36.6