Rename org.eclipse.hawkbit.api -> org.eclipse.hawkbit.artifact.repository.urlhandler (#1980)
_release_notes_ Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.autoconfigure;
|
||||
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties;
|
||||
import org.eclipse.hawkbit.api.PropertyBasedArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.PropertyBasedArtifactUrlHandler;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
|
||||
@@ -24,20 +24,17 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
|
||||
/**
|
||||
* A configuration for configuring the spring {@link CacheManager} for specific
|
||||
* multi-tenancy caching. The caches between tenants must not interfere each
|
||||
* other.
|
||||
* A configuration for configuring the spring {@link CacheManager} for specific multi-tenancy caching. The caches between
|
||||
* tenants must not interfere each other.
|
||||
*
|
||||
* This is done by providing a special {@link TenantCacheResolver} which
|
||||
* generates a cache name included the current tenant.
|
||||
* This is done by providing a special {@link TenancyCacheManager} which generates a cache name included the current tenant.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
public class CacheAutoConfiguration {
|
||||
|
||||
/**
|
||||
* @return the default cache manager bean if none other cache manager is
|
||||
* existing.
|
||||
* @return the default cache manager bean if none other cache manager is existing.
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
/**
|
||||
* hawkBit API type.
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
|
||||
* Utility class for Base10 to Base62 conversion and vice versa. Base62 has the benefit of being shorter in ASCII representation than Base10.
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public final class Base62Util {
|
||||
final class Base62Util {
|
||||
|
||||
private static final String BASE62_ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
private static final int BASE62_BASE = BASE62_ALPHABET.length();
|
||||
@@ -25,7 +25,7 @@ public final class Base62Util {
|
||||
* @param l number
|
||||
* @return converted number into Base62 ASCII string
|
||||
*/
|
||||
public static String fromBase10(final long l) {
|
||||
static String fromBase10(final long l) {
|
||||
if (l == 0) {
|
||||
return "0";
|
||||
}
|
||||
@@ -43,11 +43,11 @@ public final class Base62Util {
|
||||
* @param base62 number
|
||||
* @return converted number into Base10
|
||||
*/
|
||||
public static Long toBase10(final String base62) {
|
||||
static Long toBase10(final String base62) {
|
||||
return toBase10(new StringBuilder(base62).reverse().toString().toCharArray());
|
||||
}
|
||||
|
||||
private static Long fromBase10(final long l, final StringBuilder sb) {
|
||||
static Long fromBase10(final long l, final StringBuilder sb) {
|
||||
final int rem = (int) (l % BASE62_BASE);
|
||||
sb.append(BASE62_ALPHABET.charAt(rem));
|
||||
return l / BASE62_BASE;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URLEncoder;
|
||||
@@ -21,21 +21,20 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties.UrlProtocol;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties.UrlProtocol;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Implementation for ArtifactUrlHandler for creating urls to download resource
|
||||
* based on patterns configured by {@link ArtifactUrlHandlerProperties}.
|
||||
* Implementation for ArtifactUrlHandler for creating urls to download resource based on patterns configured by
|
||||
* {@link ArtifactUrlHandlerProperties}.
|
||||
*
|
||||
* This mechanism can be used to generate links to arbitrary file hosting
|
||||
* infrastructure. However, the hawkBit update server supports hosting files as
|
||||
* well in the following {@link UrlProtocol#getRef()} patterns:
|
||||
* This mechanism can be used to generate links to arbitrary file hosting infrastructure. However, the hawkBit update server
|
||||
* supports hosting files as well in the following {@link UrlProtocol#getRef()} patterns:
|
||||
*
|
||||
* Default:
|
||||
* {protocol}://{hostname}:{port}{contextPath}/{tenant}/controller/v1/{controllerId}/
|
||||
* softwaremodules/{softwareModuleId}/artifacts/{artifactFileName}
|
||||
* {protocol}://{hostname}:{port}{contextPath}/{tenant}/controller/v1/{controllerId}
|
||||
* /softwaremodules/{softwareModuleId}/artifacts/{artifactFileName}
|
||||
*
|
||||
* Default (MD5SUM files):
|
||||
* {protocol}://{hostname}:{port}{contextPath}/{tenant}/controller/v1/{controllerId}/
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -30,8 +30,7 @@ public class URLPlaceholder {
|
||||
* @param tenantId of teh tenant
|
||||
* @param controllerId of the target
|
||||
* @param targetId of the target
|
||||
* @param softwareData information about the artifact and software module that can be
|
||||
* accessed by the URL.
|
||||
* @param softwareData information about the artifact and software module that can be accessed by the URL.
|
||||
*/
|
||||
public URLPlaceholder(final String tenant, final Long tenantId, final String controllerId, final Long targetId,
|
||||
final SoftwareData softwareData) {
|
||||
@@ -62,8 +61,7 @@ public class URLPlaceholder {
|
||||
* @param artifactId of the artifact
|
||||
* @param sha1Hash of the artifact
|
||||
*/
|
||||
public SoftwareData(final Long softwareModuleId, final String filename, final Long artifactId,
|
||||
final String sha1Hash) {
|
||||
public SoftwareData(final Long softwareModuleId, final String filename, final Long artifactId, final String sha1Hash) {
|
||||
this.softwareModuleId = softwareModuleId;
|
||||
this.filename = filename;
|
||||
this.artifactId = artifactId;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -18,8 +18,14 @@ import java.util.List;
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties.UrlProtocol;
|
||||
import org.eclipse.hawkbit.api.URLPlaceholder.SoftwareData;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ApiType;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrl;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties.UrlProtocol;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.PropertyBasedArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder.SoftwareData;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -7,13 +7,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.api;
|
||||
package org.eclipse.hawkbit.artifact.repository.urlhandler;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Feature("Unit Tests - Artifact URL Handler")
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.dmf.amqp.api.AmqpSettings;
|
||||
import org.eclipse.hawkbit.repository.ConfirmationManagement;
|
||||
import org.eclipse.hawkbit.repository.ControllerManagement;
|
||||
|
||||
@@ -28,11 +28,11 @@ import java.util.stream.StreamSupport;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.IterableUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.eclipse.hawkbit.api.ApiType;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrl;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.api.URLPlaceholder;
|
||||
import org.eclipse.hawkbit.api.URLPlaceholder.SoftwareData;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ApiType;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrl;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder.SoftwareData;
|
||||
import org.eclipse.hawkbit.dmf.amqp.api.EventTopic;
|
||||
import org.eclipse.hawkbit.dmf.amqp.api.MessageHeaderKey;
|
||||
import org.eclipse.hawkbit.dmf.amqp.api.MessageType;
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.util.UUID;
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrl;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrl;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystem;
|
||||
import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact;
|
||||
import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash;
|
||||
|
||||
@@ -18,8 +18,8 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.eclipse.hawkbit.ContextAware;
|
||||
import org.eclipse.hawkbit.ControllerPollProperties;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties;
|
||||
import org.eclipse.hawkbit.api.PropertyBasedArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.PropertyBasedArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemProperties;
|
||||
import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemRepository;
|
||||
import org.eclipse.hawkbit.artifact.repository.ArtifactRepository;
|
||||
|
||||
@@ -13,10 +13,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.api.ApiType;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.api.URLPlaceholder;
|
||||
import org.eclipse.hawkbit.api.URLPlaceholder.SoftwareData;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ApiType;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder.SoftwareData;
|
||||
import org.eclipse.hawkbit.ddi.json.model.DdiArtifact;
|
||||
import org.eclipse.hawkbit.ddi.json.model.DdiArtifactHash;
|
||||
import org.eclipse.hawkbit.ddi.json.model.DdiAutoConfirmationState;
|
||||
|
||||
@@ -22,7 +22,7 @@ import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
||||
import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback;
|
||||
import org.eclipse.hawkbit.ddi.json.model.DdiActionHistory;
|
||||
|
||||
@@ -19,10 +19,10 @@ import java.util.stream.Collectors;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.eclipse.hawkbit.api.ApiType;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrl;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.api.URLPlaceholder;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ApiType;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrl;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifactHash;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.Optional;
|
||||
import jakarta.validation.ValidationException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.PagedList;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
|
||||
|
||||
Reference in New Issue
Block a user