Skip to content

Package: DeviceManagementResponseCodeException

DeviceManagementResponseCodeException

nameinstructionbranchcomplexitylinemethod
DeviceManagementResponseCodeException(DeviceManagementErrorCodes, KapuaResponseCode, String, String)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getErrorMessage()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getResponseCode()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getStacktrace()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2021, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.device.management.exception;
14:
15: import org.eclipse.kapua.service.device.management.message.response.KapuaResponseCode;
16: import org.eclipse.kapua.service.device.management.message.response.KapuaResponseMessage;
17:
18: import javax.validation.constraints.NotNull;
19: import javax.validation.constraints.Null;
20:
21: /**
22: * {@link DeviceManagementResponseException} when a {@link KapuaResponseMessage#getResponseCode()} is not {@link KapuaResponseCode#ACCEPTED}
23: *
24: * @since 1.5.0
25: */
26: public abstract class DeviceManagementResponseCodeException extends DeviceManagementResponseException {
27:
28: private final KapuaResponseCode responseCode;
29: private final String errorMessage;
30: private final String stacktrace;
31:
32: /**
33: * @since 1.5.0
34: */
35: protected DeviceManagementResponseCodeException(@NotNull DeviceManagementErrorCodes code, @NotNull KapuaResponseCode responseCode, @Null String errorMessage, @Null String stacktrace) {
36: super(code, null, responseCode, errorMessage, stacktrace);
37:
38: this.responseCode = responseCode;
39: this.errorMessage = errorMessage;
40: this.stacktrace = stacktrace;
41: }
42:
43: public KapuaResponseCode getResponseCode() {
44: return responseCode;
45: }
46:
47: public String getErrorMessage() {
48: return errorMessage;
49: }
50:
51: public String getStacktrace() {
52: return stacktrace;
53: }
54: }