Remove org.eclipse.hawkbit.api.ProtocolProperties (#1977)
_release_notes_ Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -1,42 +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.api;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for declaring common properties through all supported protocols
|
|
||||||
* pattern.
|
|
||||||
*/
|
|
||||||
public interface ProtocolProperties {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the hostname value to resolve in the pattern.
|
|
||||||
*/
|
|
||||||
String getHostname();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the IP address value to resolve in the pattern.
|
|
||||||
*/
|
|
||||||
String getIp();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the port value to resolve in the pattern.
|
|
||||||
*/
|
|
||||||
String getPort();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the pattern to build the URL.
|
|
||||||
*/
|
|
||||||
String getPattern();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return <code>true</code> if the {@link ProtocolProperties} is enabled.
|
|
||||||
*/
|
|
||||||
boolean isEnabled();
|
|
||||||
}
|
|
||||||
@@ -93,17 +93,9 @@ public abstract class AbstractServerRtException extends RuntimeException {
|
|||||||
* @param error detail
|
* @param error detail
|
||||||
* @param cause of the exception
|
* @param cause of the exception
|
||||||
*/
|
*/
|
||||||
protected AbstractServerRtException(final String message, final SpServerError error, final Throwable cause,
|
protected AbstractServerRtException(final String message, final SpServerError error, final Throwable cause, final Map<String, Object> info) {
|
||||||
final Map<String, Object> info) {
|
|
||||||
super(message, cause);
|
super(message, cause);
|
||||||
this.error = error;
|
this.error = error;
|
||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the SpServerError which is wrapped by this exception
|
|
||||||
*/
|
|
||||||
public SpServerError getError() {
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,6 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.exception;
|
package org.eclipse.hawkbit.exception;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link GenericSpServerException} is thrown when a given entity in's actual
|
* {@link GenericSpServerException} is thrown when a given entity in's actual
|
||||||
* and cannot be stored within the current session. Reason could be that it has
|
* and cannot be stored within the current session. Reason could be that it has
|
||||||
@@ -16,42 +18,12 @@ package org.eclipse.hawkbit.exception;
|
|||||||
*/
|
*/
|
||||||
public class GenericSpServerException extends AbstractServerRtException {
|
public class GenericSpServerException extends AbstractServerRtException {
|
||||||
|
|
||||||
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final SpServerError THIS_ERROR = SpServerError.SP_REPO_GENERIC_ERROR;
|
private static final SpServerError THIS_ERROR = SpServerError.SP_REPO_GENERIC_ERROR;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*/
|
|
||||||
public GenericSpServerException() {
|
|
||||||
super(THIS_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parameterized constructor.
|
|
||||||
*
|
|
||||||
* @param cause of the exception
|
|
||||||
*/
|
|
||||||
public GenericSpServerException(final Throwable cause) {
|
public GenericSpServerException(final Throwable cause) {
|
||||||
super(THIS_ERROR, cause);
|
super(THIS_ERROR, cause);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Parameterized constructor.
|
|
||||||
*
|
|
||||||
* @param message custom error message
|
|
||||||
* @param cause of the exception
|
|
||||||
*/
|
|
||||||
public GenericSpServerException(final String message, final Throwable cause) {
|
|
||||||
super(message, THIS_ERROR, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parameterized constructor.
|
|
||||||
*
|
|
||||||
* @param message custom error message
|
|
||||||
*/
|
|
||||||
public GenericSpServerException(final String message) {
|
|
||||||
super(message, THIS_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -9,10 +9,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.exception;
|
package org.eclipse.hawkbit.exception;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the Error code for Error handling
|
* Define the Error code for Error handling
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
public enum SpServerError {
|
public enum SpServerError {
|
||||||
|
|
||||||
SP_REPO_GENERIC_ERROR("hawkbit.server.error.repo.genericError", "unknown error occurred"),
|
SP_REPO_GENERIC_ERROR("hawkbit.server.error.repo.genericError", "unknown error occurred"),
|
||||||
@@ -147,30 +150,11 @@ public enum SpServerError {
|
|||||||
private final String key;
|
private final String key;
|
||||||
private final String message;
|
private final String message;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Repository side Error codes
|
* Repository side Error codes
|
||||||
*/
|
*/
|
||||||
SpServerError(final String errorKey, final String message) {
|
SpServerError(final String key, final String message) {
|
||||||
key = errorKey;
|
this.key = key;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Gets the key of the error
|
|
||||||
*
|
|
||||||
* @return the key of the error
|
|
||||||
*/
|
|
||||||
public String getKey() {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the message of the error
|
|
||||||
*
|
|
||||||
* @return message of the error
|
|
||||||
*/
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user