Fix SonarQube issues (2) (#2205)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-01-20 16:29:45 +02:00
committed by GitHub
parent 385023d8b6
commit 5dabe9117a
33 changed files with 162 additions and 185 deletions

View File

@@ -11,18 +11,21 @@ package org.eclipse.hawkbit.repository.exception;
import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
import org.eclipse.hawkbit.exception.SpServerError;
/**
* Exception being thrown in case of error while generating encryption secrets,
* encrypting or decrypting artifacts.
* Exception being thrown in case of error while generating encryption secrets, encrypting or decrypting artifacts.
*/
@EqualsAndHashCode(callSuper = true)
public final class ArtifactEncryptionFailedException extends AbstractServerRtException {
@Serial
private static final long serialVersionUID = 1L;
@Getter
private final EncryptionOperation encryptionOperation;
public ArtifactEncryptionFailedException(final EncryptionOperation encryptionOperation) {
@@ -33,21 +36,15 @@ public final class ArtifactEncryptionFailedException extends AbstractServerRtExc
this(encryptionOperation, message, null);
}
public ArtifactEncryptionFailedException(final EncryptionOperation encryptionOperation, final String message,
final Throwable cause) {
public ArtifactEncryptionFailedException(final EncryptionOperation encryptionOperation, final String message, final Throwable cause) {
super(message, SpServerError.SP_ARTIFACT_ENCRYPTION_FAILED, cause);
this.encryptionOperation = encryptionOperation;
}
public EncryptionOperation getEncryptionOperation() {
return encryptionOperation;
}
/**
* Encryption operation that caused the exception.
*/
public enum EncryptionOperation {
GENERATE_SECRETS, ENCRYPT, DECRYPT;
}
}
}