Skip to content

Package: DeviceManagementResponseCodeExceptionInfo

DeviceManagementResponseCodeExceptionInfo

nameinstructionbranchcomplexitylinemethod
DeviceManagementResponseCodeExceptionInfo()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
DeviceManagementResponseCodeExceptionInfo(DeviceManagementResponseCodeException)
M: 19 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.app.api.core.exception.model;
14:
15: import org.eclipse.kapua.service.device.management.exception.DeviceManagementResponseCodeException;
16: import org.eclipse.kapua.service.device.management.message.response.KapuaResponseCode;
17:
18: import javax.ws.rs.core.Response.Status;
19: import javax.xml.bind.annotation.XmlAccessType;
20: import javax.xml.bind.annotation.XmlAccessorType;
21: import javax.xml.bind.annotation.XmlElement;
22: import javax.xml.bind.annotation.XmlRootElement;
23:
24:
25: @XmlRootElement(name = "deviceManagementResponseCodeExceptionInfo")
26: @XmlAccessorType(XmlAccessType.FIELD)
27: public class DeviceManagementResponseCodeExceptionInfo extends ExceptionInfo {
28:
29: @XmlElement(name = "responseCode")
30: private KapuaResponseCode responseCode;
31:
32: @XmlElement(name = "errorMessage")
33: private String errorMessage;
34:
35: @XmlElement(name = "stacktrace")
36: private String stacktrace;
37:
38: protected DeviceManagementResponseCodeExceptionInfo() {
39: // Required by JAXB
40: }
41:
42: public DeviceManagementResponseCodeExceptionInfo(DeviceManagementResponseCodeException deviceManagementResponseCodeException) {
43: super(Status.INTERNAL_SERVER_ERROR, deviceManagementResponseCodeException.getCode(), deviceManagementResponseCodeException);
44:
45: this.responseCode = deviceManagementResponseCodeException.getResponseCode();
46: this.errorMessage = deviceManagementResponseCodeException.getErrorMessage();
47: this.stacktrace = deviceManagementResponseCodeException.getStacktrace();
48:
49: }
50:
51: public KapuaResponseCode getResponseCode() {
52: return responseCode;
53: }
54:
55: public String getErrorMessage() {
56: return errorMessage;
57: }
58:
59: public String getStacktrace() {
60: return stacktrace;
61: }
62: }