Remove unusied org.eclipse.hawkbit.HawkbitServerProperties (#1979)

_release_notes_

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-08 17:18:59 +02:00
committed by GitHub
parent 56c548e474
commit 6dec398cb9
6 changed files with 11 additions and 94 deletions

View File

@@ -9,7 +9,6 @@
*/ */
package org.eclipse.hawkbit.autoconfigure; package org.eclipse.hawkbit.autoconfigure;
import org.eclipse.hawkbit.HawkbitServerProperties;
import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.api.ArtifactUrlHandler;
import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties; import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties;
import org.eclipse.hawkbit.api.PropertyBasedArtifactUrlHandler; 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. * Auto-configuration for {@link ArtifactUrlHandler} based on a properties.
*/ */
@Configuration @Configuration
@EnableConfigurationProperties({ HawkbitServerProperties.class, ArtifactUrlHandlerProperties.class }) @EnableConfigurationProperties({ ArtifactUrlHandlerProperties.class })
@PropertySource("classpath:/hawkbit-artifactdl-defaults.properties") @PropertySource("classpath:/hawkbit-artifactdl-defaults.properties")
public class ArtifactUrlHandlerAutoConfiguration { public class ArtifactUrlHandlerAutoConfiguration {

View File

@@ -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;
}
}
}

View File

@@ -16,7 +16,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.eclipse.hawkbit.HawkbitServerProperties;
import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder; import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder;
import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate; 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.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.security.concurrent.DelegatingSecurityContextExecutorService; import org.springframework.security.concurrent.DelegatingSecurityContextExecutorService;
/**
*
*/
@Configuration @Configuration
public class AmqpTestConfiguration { public class AmqpTestConfiguration {
@@ -79,4 +75,4 @@ public class AmqpTestConfiguration {
RabbitMqSetupService rabbitMqSetupService() { RabbitMqSetupService rabbitMqSetupService() {
return new RabbitMqSetupService(); return new RabbitMqSetupService();
} }
} }

View File

@@ -17,7 +17,6 @@ import java.util.Map;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import org.eclipse.hawkbit.ControllerPollProperties; 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.InvalidTenantConfigurationKeyException;
import org.eclipse.hawkbit.repository.exception.TenantConfigurationValidatorException; import org.eclipse.hawkbit.repository.exception.TenantConfigurationValidatorException;
import org.eclipse.hawkbit.tenancy.configuration.validator.TenantConfigurationStringValidator; import org.eclipse.hawkbit.tenancy.configuration.validator.TenantConfigurationStringValidator;
@@ -110,7 +109,7 @@ public class TenantConfigurationProperties {
public static final String POLLING_OVERDUE_TIME_INTERVAL = "pollingOverdueTime"; 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"; public static final String ANONYMOUS_DOWNLOAD_MODE_ENABLED = "anonymous.download.enabled";

View File

@@ -18,7 +18,6 @@ import java.util.concurrent.atomic.AtomicLong;
import org.eclipse.hawkbit.ContextAware; import org.eclipse.hawkbit.ContextAware;
import org.eclipse.hawkbit.ControllerPollProperties; import org.eclipse.hawkbit.ControllerPollProperties;
import org.eclipse.hawkbit.HawkbitServerProperties;
import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties; import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties;
import org.eclipse.hawkbit.api.PropertyBasedArtifactUrlHandler; import org.eclipse.hawkbit.api.PropertyBasedArtifactUrlHandler;
import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemProperties; import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemProperties;
@@ -75,7 +74,7 @@ import org.springframework.security.config.annotation.method.configuration.Enabl
*/ */
@Configuration @Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.PROXY, proxyTargetClass = false, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.PROXY, proxyTargetClass = false, securedEnabled = true)
@EnableConfigurationProperties({ HawkbitServerProperties.class, DdiSecurityProperties.class, @EnableConfigurationProperties({ DdiSecurityProperties.class,
ArtifactUrlHandlerProperties.class, ArtifactFilesystemProperties.class, HawkbitSecurityProperties.class, ArtifactUrlHandlerProperties.class, ArtifactFilesystemProperties.class, HawkbitSecurityProperties.class,
ControllerPollProperties.class, TenantConfigurationProperties.class }) ControllerPollProperties.class, TenantConfigurationProperties.class })
@Profile("test") @Profile("test")

View File

@@ -61,7 +61,7 @@ public class HawkbitClient {
log.trace("REST API call failed!", e); log.trace("REST API call failed!", e);
return e; return e;
}; };
private final HawkbitServer hawkBitServerProperties; private final HawkbitServer hawkBitServer;
private final Client client; private final Client client;
private final Encoder encoder; private final Encoder encoder;
@@ -72,20 +72,20 @@ public class HawkbitClient {
private final BiFunction<Tenant, Controller, RequestInterceptor> requestInterceptorFn; private final BiFunction<Tenant, Controller, RequestInterceptor> requestInterceptorFn;
public HawkbitClient( public HawkbitClient(
final HawkbitServer hawkBitServerProperties, final HawkbitServer hawkBitServer,
final Client client, final Encoder encoder, final Decoder decoder, final Contract contract) { 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 * Customizers gets default ones and could
*/ */
public HawkbitClient( public HawkbitClient(
final HawkbitServer hawkBitServerProperties, final HawkbitServer hawkBitServer,
final Client client, final Encoder encoder, final Decoder decoder, final Contract contract, final Client client, final Encoder encoder, final Decoder decoder, final Contract contract,
final ErrorDecoder errorDecoder, final ErrorDecoder errorDecoder,
final BiFunction<Tenant, Controller, RequestInterceptor> requestInterceptorFn) { final BiFunction<Tenant, Controller, RequestInterceptor> requestInterceptorFn) {
this.hawkBitServerProperties = hawkBitServerProperties; this.hawkBitServer = hawkBitServer;
this.client = client; this.client = client;
this.encoder = encoder; this.encoder = encoder;
this.decoder = decoder; this.decoder = decoder;
@@ -112,7 +112,7 @@ public class HawkbitClient {
.requestInterceptor(requestInterceptorFn.apply(tenant, controller)) .requestInterceptor(requestInterceptorFn.apply(tenant, controller))
.target(serviceType, .target(serviceType,
controller == null ? controller == null ?
hawkBitServerProperties.getMgmtUrl() : hawkBitServer.getMgmtUrl() :
hawkBitServerProperties.getDdiUrl()); hawkBitServer.getDdiUrl());
} }
} }