diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/ArtifactUrlHandlerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/ArtifactUrlHandlerAutoConfiguration.java index 2741aa4c5..e36f83339 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/ArtifactUrlHandlerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/ArtifactUrlHandlerAutoConfiguration.java @@ -9,7 +9,6 @@ */ package org.eclipse.hawkbit.autoconfigure; -import org.eclipse.hawkbit.HawkbitServerProperties; import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties; import org.eclipse.hawkbit.api.PropertyBasedArtifactUrlHandler; @@ -24,7 +23,7 @@ import org.springframework.context.annotation.PropertySource; * Auto-configuration for {@link ArtifactUrlHandler} based on a properties. */ @Configuration -@EnableConfigurationProperties({ HawkbitServerProperties.class, ArtifactUrlHandlerProperties.class }) +@EnableConfigurationProperties({ ArtifactUrlHandlerProperties.class }) @PropertySource("classpath:/hawkbit-artifactdl-defaults.properties") public class ArtifactUrlHandlerAutoConfiguration { diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/HawkbitServerProperties.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/HawkbitServerProperties.java deleted file mode 100644 index b2701ea69..000000000 --- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/HawkbitServerProperties.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.eclipse.hawkbit; - -import lombok.Data; -import lombok.Getter; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Properties for the server e.g. the server's URL which must be configured. - */ -@Getter -@ConfigurationProperties("hawkbit.server") -public class HawkbitServerProperties { - - private final Anonymous anonymous = new Anonymous(); - private final Build build = new Build(); - /** - * Defines under which URI the update server can be reached. Used to - * calculate download URLs for DMF transmitted update actions. - */ - private String url = "http://localhost:8080"; - - public void setUrl(final String url) { - this.url = url; - } - - /** - * Properties for anonymous API access by Devices/Controllers. - */ - @Getter - public static class Anonymous { - - private final Download download = new Download(); - - /** - * Properties for artifact download under anonymous API access by - * Devices/Controllers. - */ - @Data - public static class Download { - - /** - * Unauthenticated artifact download possible if true. - */ - private boolean enabled; - } - } - - /** - * Build information of the hawkBit instance. Influenced by maven. - */ - public static class Build { - - /** - * Project version. - */ - private String version = ""; - - public String getVersion() { - return version; - } - - public void setVersion(final String version) { - this.version = version; - } - - } -} diff --git a/hawkbit-dmf/hawkbit-dmf-rabbitmq-test/src/main/java/org/eclipse/hawkbit/rabbitmq/test/AmqpTestConfiguration.java b/hawkbit-dmf/hawkbit-dmf-rabbitmq-test/src/main/java/org/eclipse/hawkbit/rabbitmq/test/AmqpTestConfiguration.java index 5a8a5f5d3..1a15d1ad4 100644 --- a/hawkbit-dmf/hawkbit-dmf-rabbitmq-test/src/main/java/org/eclipse/hawkbit/rabbitmq/test/AmqpTestConfiguration.java +++ b/hawkbit-dmf/hawkbit-dmf-rabbitmq-test/src/main/java/org/eclipse/hawkbit/rabbitmq/test/AmqpTestConfiguration.java @@ -16,7 +16,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import org.eclipse.hawkbit.HawkbitServerProperties; import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.core.RabbitTemplate; @@ -29,9 +28,6 @@ import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.security.concurrent.DelegatingSecurityContextExecutorService; -/** - * - */ @Configuration public class AmqpTestConfiguration { @@ -79,4 +75,4 @@ public class AmqpTestConfiguration { RabbitMqSetupService rabbitMqSetupService() { return new RabbitMqSetupService(); } -} +} \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/tenancy/configuration/TenantConfigurationProperties.java b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/tenancy/configuration/TenantConfigurationProperties.java index 3da5d9bf1..080b5dd37 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/tenancy/configuration/TenantConfigurationProperties.java +++ b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/tenancy/configuration/TenantConfigurationProperties.java @@ -17,7 +17,6 @@ import java.util.Map; import lombok.Data; import lombok.ToString; import org.eclipse.hawkbit.ControllerPollProperties; -import org.eclipse.hawkbit.HawkbitServerProperties.Anonymous.Download; import org.eclipse.hawkbit.repository.exception.InvalidTenantConfigurationKeyException; import org.eclipse.hawkbit.repository.exception.TenantConfigurationValidatorException; import org.eclipse.hawkbit.tenancy.configuration.validator.TenantConfigurationStringValidator; @@ -110,7 +109,7 @@ public class TenantConfigurationProperties { public static final String POLLING_OVERDUE_TIME_INTERVAL = "pollingOverdueTime"; /** - * See system default {@link Download#isEnabled()}. + * If anonymous downloads are enabled */ public static final String ANONYMOUS_DOWNLOAD_MODE_ENABLED = "anonymous.download.enabled"; diff --git a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java index f02a2180d..f5735c140 100644 --- a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java +++ b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java @@ -18,7 +18,6 @@ import java.util.concurrent.atomic.AtomicLong; import org.eclipse.hawkbit.ContextAware; import org.eclipse.hawkbit.ControllerPollProperties; -import org.eclipse.hawkbit.HawkbitServerProperties; import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties; import org.eclipse.hawkbit.api.PropertyBasedArtifactUrlHandler; import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemProperties; @@ -75,7 +74,7 @@ import org.springframework.security.config.annotation.method.configuration.Enabl */ @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.PROXY, proxyTargetClass = false, securedEnabled = true) -@EnableConfigurationProperties({ HawkbitServerProperties.class, DdiSecurityProperties.class, +@EnableConfigurationProperties({ DdiSecurityProperties.class, ArtifactUrlHandlerProperties.class, ArtifactFilesystemProperties.class, HawkbitSecurityProperties.class, ControllerPollProperties.class, TenantConfigurationProperties.class }) @Profile("test") diff --git a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java index d170277de..3964a261c 100644 --- a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java +++ b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java @@ -61,7 +61,7 @@ public class HawkbitClient { log.trace("REST API call failed!", e); return e; }; - private final HawkbitServer hawkBitServerProperties; + private final HawkbitServer hawkBitServer; private final Client client; private final Encoder encoder; @@ -72,20 +72,20 @@ public class HawkbitClient { private final BiFunction requestInterceptorFn; public HawkbitClient( - final HawkbitServer hawkBitServerProperties, + final HawkbitServer hawkBitServer, final Client client, final Encoder encoder, final Decoder decoder, final Contract contract) { - this(hawkBitServerProperties, client, encoder, decoder, contract, null, null); + this(hawkBitServer, client, encoder, decoder, contract, null, null); } /** * Customizers gets default ones and could */ public HawkbitClient( - final HawkbitServer hawkBitServerProperties, + final HawkbitServer hawkBitServer, final Client client, final Encoder encoder, final Decoder decoder, final Contract contract, final ErrorDecoder errorDecoder, final BiFunction requestInterceptorFn) { - this.hawkBitServerProperties = hawkBitServerProperties; + this.hawkBitServer = hawkBitServer; this.client = client; this.encoder = encoder; this.decoder = decoder; @@ -112,7 +112,7 @@ public class HawkbitClient { .requestInterceptor(requestInterceptorFn.apply(tenant, controller)) .target(serviceType, controller == null ? - hawkBitServerProperties.getMgmtUrl() : - hawkBitServerProperties.getDdiUrl()); + hawkBitServer.getMgmtUrl() : + hawkBitServer.getDdiUrl()); } } \ No newline at end of file