Spring Boot 2.0 (#721)
* Migration to Boot 2.0. Signed-off-by: Kai Zimmermann <kai.zimmermann@microsoft.com>
This commit is contained in:
@@ -24,8 +24,8 @@ import org.eclipse.hawkbit.repository.builder.ActionStatusCreate;
|
||||
import org.eclipse.hawkbit.repository.exception.CancelActionNotAllowedException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.QuotaExceededException;
|
||||
import org.eclipse.hawkbit.repository.exception.InvalidTargetAttributeException;
|
||||
import org.eclipse.hawkbit.repository.exception.QuotaExceededException;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||
@@ -400,9 +400,9 @@ public interface ControllerManagement {
|
||||
|
||||
/**
|
||||
* Cancels given {@link Action} for this {@link Target}. However, it might
|
||||
* be possible that the controller will continue to work on the cancelation.
|
||||
* The controller needs to acknowledge or reject the cancelation using
|
||||
* {@link DdiRootController#postCancelActionFeedback}.
|
||||
* be possible that the controller will continue to work on the
|
||||
* cancellation. The controller needs to acknowledge or reject the
|
||||
* cancellation using {@link DdiRootController#postCancelActionFeedback}.
|
||||
*
|
||||
* @param actionId
|
||||
* to be canceled
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.data.domain.Sort;
|
||||
public final class OffsetBasedPageRequest extends PageRequest {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final int offset;
|
||||
private final long offset;
|
||||
|
||||
/**
|
||||
* Creates a new {@link OffsetBasedPageRequest}. Offsets are zero indexed,
|
||||
@@ -32,8 +32,8 @@ public final class OffsetBasedPageRequest extends PageRequest {
|
||||
* @param limit
|
||||
* the limit of the page to be returned.
|
||||
*/
|
||||
public OffsetBasedPageRequest(final int offset, final int limit) {
|
||||
this(offset, limit, null);
|
||||
public OffsetBasedPageRequest(final long offset, final int limit) {
|
||||
this(offset, limit, Sort.unsorted());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,13 +47,13 @@ public final class OffsetBasedPageRequest extends PageRequest {
|
||||
* @param sort
|
||||
* sort can be {@literal null}.
|
||||
*/
|
||||
public OffsetBasedPageRequest(final int offset, final int limit, final Sort sort) {
|
||||
public OffsetBasedPageRequest(final long offset, final int limit, final Sort sort) {
|
||||
super(0, limit, sort);
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
public long getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public final class OffsetBasedPageRequest extends PageRequest {
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + offset;
|
||||
result = prime * result + (int) (offset ^ (offset >>> 32));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -79,11 +79,14 @@ public final class OffsetBasedPageRequest extends PageRequest {
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof OffsetBasedPageRequest)) {
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final OffsetBasedPageRequest other = (OffsetBasedPageRequest) obj;
|
||||
return offset == other.offset;
|
||||
if (offset != other.offset) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -631,6 +631,7 @@ public interface TargetManagement {
|
||||
* @throws EntityNotFoundException
|
||||
* if target with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Map<String, String> getControllerAttributes(@NotEmpty String controllerId);
|
||||
|
||||
/**
|
||||
@@ -642,6 +643,7 @@ public interface TargetManagement {
|
||||
* @throws EntityNotFoundException
|
||||
* if target with given ID does not exist
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
|
||||
void requestControllerAttributes(@NotEmpty String controllerId);
|
||||
|
||||
/**
|
||||
@@ -652,8 +654,33 @@ public interface TargetManagement {
|
||||
* @return {@code true}: update of controller attributes triggered.
|
||||
* {@code false}: update of controller attributes not requested.
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
boolean isControllerAttributesRequested(@NotEmpty String controllerId);
|
||||
|
||||
/**
|
||||
* Retrieves {@link Target}s where
|
||||
* {@link #isControllerAttributesRequested(String)}.
|
||||
*
|
||||
* @param pageReq
|
||||
* page parameter
|
||||
*
|
||||
* @return the found {@link Target}s
|
||||
*
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
Page<Target> findByControllerAttributesRequested(@NotNull Pageable pageReq);
|
||||
|
||||
/**
|
||||
* Verifies that {@link Target} with given controller ID exists in the
|
||||
* repository.
|
||||
*
|
||||
* @param controllerId
|
||||
* of target
|
||||
* @return {@code true} if target with given ID exists
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
boolean existsByControllerId(@NotEmpty String controllerId);
|
||||
|
||||
/**
|
||||
* Creates a list of target meta data entries.
|
||||
*
|
||||
|
||||
@@ -40,7 +40,7 @@ public class RemoteTenantAwareEvent extends RemoteApplicationEvent implements Te
|
||||
* the applicationId
|
||||
*/
|
||||
public RemoteTenantAwareEvent(final Object source, final String tenant, final String applicationId) {
|
||||
super(source, applicationId, "**");
|
||||
super(source, applicationId);
|
||||
this.tenant = tenant;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public final class ArtifactBinaryNotFoundException extends AbstractServerRtExcep
|
||||
|
||||
/**
|
||||
* Creates a new FileUploadFailedException with
|
||||
* {@link SpServerError#SP_REST_BODY_NOT_READABLE} error.
|
||||
* {@link SpServerError#SP_ARTIFACT_LOAD_FAILED} error.
|
||||
*/
|
||||
public ArtifactBinaryNotFoundException() {
|
||||
super(SpServerError.SP_ARTIFACT_LOAD_FAILED);
|
||||
|
||||
@@ -26,7 +26,7 @@ public final class ArtifactDeleteFailedException extends AbstractServerRtExcepti
|
||||
|
||||
/**
|
||||
* Creates a new FileUploadFailedException with
|
||||
* {@link SpServerError#SP_REST_BODY_NOT_READABLE} error.
|
||||
* {@link SpServerError#SP_ARTIFACT_DELETE_FAILED} error.
|
||||
*/
|
||||
public ArtifactDeleteFailedException() {
|
||||
super(SpServerError.SP_ARTIFACT_DELETE_FAILED);
|
||||
|
||||
@@ -22,7 +22,7 @@ public final class ArtifactUploadFailedException extends AbstractServerRtExcepti
|
||||
|
||||
/**
|
||||
* Creates a new FileUploadFailedException with
|
||||
* {@link SpServerError#SP_REST_BODY_NOT_READABLE} error.
|
||||
* {@link SpServerError#SP_ARTIFACT_UPLOAD_FAILED} error.
|
||||
*/
|
||||
public ArtifactUploadFailedException() {
|
||||
super(SpServerError.SP_ARTIFACT_UPLOAD_FAILED);
|
||||
|
||||
@@ -8,13 +8,15 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.rsql;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Implementations map a placeholder to the associated value.
|
||||
* <p>
|
||||
* This is used in context of string replacement.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface VirtualPropertyReplacer {
|
||||
public interface VirtualPropertyReplacer extends Serializable {
|
||||
|
||||
/**
|
||||
* Looks up a placeholders and replaces them
|
||||
|
||||
Reference in New Issue
Block a user