Notes: 1. (!) Eclipselink shall be migrated to 5.0 (in 4.0.8 there are incompatible classes, e.g EJBQueryImpl doesn't implement some newer methods). In the moment is with beta (5.0.0-B12) - JUST for testing! 2. (!) Ethlo plugin doesn't work with Eclipselink 5.0, it builds with Eclipselink 4.0.8 (could be a problem) 3. Dependencies - new starters, test starters changes, some dependencies refactoring 4. Auto-configs split - package changes, some properties classes changes 5. Spring nullable org.springframework.lang.Nullable/NonNull are depecated and replaced with jspcify -> org.jspecify.annotations.Nullable/NonNull (NullMarked) 6. Lombok config - adding lombok.addNullAnnotations=jspecify - to do not mess annotations 7. Distributed lock table changes - SP_LOCK table db migration 8. Spring Retry replaced with Spring Core Retry - does repace retry in hawkbit 9. Specifications -> added Update/Delete(/Predicate) Specifications and JpaSpecificationExecutor changed 10. HawkbitBaseRepositoryFactoryBean modified to register properly 11. Jackson - 2 -> 3, package migrations, finals are not deserialized by default(enable finals deserialization, consider make non-final), too ‘smart’ tries to set complex objects instead of using non args constructor (-> @JsonIgnore), some other default configs made Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -11,8 +11,8 @@ package org.eclipse.hawkbit.sdk;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
|
||||
@@ -44,7 +44,6 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import feign.Contract;
|
||||
import feign.Feign;
|
||||
import feign.FeignException;
|
||||
@@ -85,6 +84,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
@Slf4j
|
||||
@Builder
|
||||
@@ -264,7 +264,7 @@ public class HawkbitClient {
|
||||
private Object callMultipartFormDataRequest(
|
||||
final Method method, final Object[] args,
|
||||
final Tenant tenant, final Controller controller,
|
||||
final Class<?>[] parameterTypes, final ObjectMapper objectMapper) throws URISyntaxException, IOException {
|
||||
final Class<?>[] parameterTypes, final ObjectMapper objectMapper) throws IOException, URISyntaxException {
|
||||
final PostMapping postMapping = method.getAnnotation(PostMapping.class);
|
||||
final Annotation[][] parametersAnnotations = method.getParameterAnnotations();
|
||||
// build path - replace @PathVariables
|
||||
@@ -322,11 +322,11 @@ public class HawkbitClient {
|
||||
|
||||
return method.getReturnType() == ResponseEntity.class
|
||||
? new ResponseEntity<>(
|
||||
deserialize(
|
||||
conn.getInputStream(),
|
||||
(Class<?>) ((ParameterizedType) method.getGenericReturnType()).getActualTypeArguments()[0],
|
||||
objectMapper),
|
||||
HttpStatusCode.valueOf(responseCode))
|
||||
deserialize(
|
||||
conn.getInputStream(),
|
||||
(Class<?>) ((ParameterizedType) method.getGenericReturnType()).getActualTypeArguments()[0],
|
||||
objectMapper),
|
||||
HttpStatusCode.valueOf(responseCode))
|
||||
: deserialize(conn.getInputStream(), method.getReturnType(), objectMapper);
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ public class HawkbitClient {
|
||||
}
|
||||
}
|
||||
|
||||
private static Object deserialize(final InputStream is, final Class<?> type, final ObjectMapper objectMapper) throws IOException {
|
||||
private static Object deserialize(final InputStream is, final Class<?> type, final ObjectMapper objectMapper) {
|
||||
return type == void.class || type == Void.class ? null : objectMapper.readValue(is, type);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.sdk;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
|
||||
@ConfigurationProperties(prefix = "hawkbit.server")
|
||||
@Data
|
||||
|
||||
@@ -15,8 +15,8 @@ import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.sdk.ca.CA;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
@ConfigurationProperties("hawkbit.tenant")
|
||||
@Data
|
||||
|
||||
Reference in New Issue
Block a user