From 58ed0c0821957369641aa1043ae0682a79e62156 Mon Sep 17 00:00:00 2001 From: Julien Giovaresco Date: Mon, 25 Mar 2024 11:10:27 +0100 Subject: [PATCH 1/2] feat: change IntegrationProviderFactory signature to rely on Spring env Instead of providing a serialized configuration, we provide the Spring environment with a prefix that will be used to fetch configuration attributes. --- .../api/plugin/IntegrationProviderFactory.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/gravitee/integration/api/plugin/IntegrationProviderFactory.java b/src/main/java/io/gravitee/integration/api/plugin/IntegrationProviderFactory.java index 07e6e13..69ae8e8 100644 --- a/src/main/java/io/gravitee/integration/api/plugin/IntegrationProviderFactory.java +++ b/src/main/java/io/gravitee/integration/api/plugin/IntegrationProviderFactory.java @@ -16,10 +16,19 @@ package io.gravitee.integration.api.plugin; +import org.springframework.core.env.Environment; + /** * @author Remi Baptiste (remi.baptiste at graviteesource.com) * @author GraviteeSource Team */ public interface IntegrationProviderFactory { - I createIntegrationProvider(String id, String configuration); + /** + * Create an integration provider using Spring Environment and a Prefix to load the configuration + * @param id The id of the integration provider. + * @param environment The Spring Environment where to load the configuration. + * @param prefix The prefix to use to load the configuration. + * @return The created integration provider. + */ + I createIntegrationProvider(String id, Environment environment, String prefix); } From 08e5431cb24490b6f9584a364342f669d66c77f9 Mon Sep 17 00:00:00 2001 From: Julien Giovaresco Date: Mon, 25 Mar 2024 11:13:05 +0100 Subject: [PATCH 2/2] fix: remove AbstractIntegrationProviderConfiguration --- ...tractIntegrationProviderConfiguration.java | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/main/java/io/gravitee/integration/api/plugin/configuration/AbstractIntegrationProviderConfiguration.java diff --git a/src/main/java/io/gravitee/integration/api/plugin/configuration/AbstractIntegrationProviderConfiguration.java b/src/main/java/io/gravitee/integration/api/plugin/configuration/AbstractIntegrationProviderConfiguration.java deleted file mode 100644 index 2b0e173..0000000 --- a/src/main/java/io/gravitee/integration/api/plugin/configuration/AbstractIntegrationProviderConfiguration.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright © 2015 The Gravitee team (http://gravitee.io) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.gravitee.integration.api.plugin.configuration; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.SuperBuilder; - -/** - * @author Remi Baptiste (remi.baptiste at graviteesource.com) - * @author GraviteeSource Team - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@SuperBuilder -public abstract class AbstractIntegrationProviderConfiguration implements IntegrationProviderConfiguration { - - private String id; -}