Skip to content

Package: ServiceConfigurationParentLimitExceededExceptionInfo

ServiceConfigurationParentLimitExceededExceptionInfo

nameinstructionbranchcomplexitylinemethod
ServiceConfigurationParentLimitExceededExceptionInfo()
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%
ServiceConfigurationParentLimitExceededExceptionInfo(ServiceConfigurationParentLimitExceededException)
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%
getLimitExceededBy()
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%
getParentScopeId()
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%
getServicePid()
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.commons.configuration.exception.ServiceConfigurationParentLimitExceededException;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.service.config.KapuaConfigurableService;
18:
19: import javax.ws.rs.core.Response;
20: import javax.xml.bind.annotation.XmlAccessType;
21: import javax.xml.bind.annotation.XmlAccessorType;
22: import javax.xml.bind.annotation.XmlElement;
23: import javax.xml.bind.annotation.XmlRootElement;
24:
25: @XmlRootElement(name = "serviceConfigurationParentLimitExceededExceptionInfo")
26: @XmlAccessorType(XmlAccessType.FIELD)
27: public class ServiceConfigurationParentLimitExceededExceptionInfo extends ExceptionInfo {
28:
29:
30: @XmlElement(name = "servicePid")
31: private String servicePid;
32:
33: @XmlElement(name = "parentScopeId")
34:
35: private KapuaId parentScopeId;
36:
37: @XmlElement(name = "limitExceededBy")
38: private long limitExceededBy;
39:
40: /**
41: * Constructor.
42: *
43: * @since 1.0.0
44: */
45: protected ServiceConfigurationParentLimitExceededExceptionInfo() {
46: super();
47: }
48:
49: /**
50: * Constructor.
51: *
52: * @param serviceConfigurationParentLimitExceededException The root exception.
53: * @since 1.0.0
54: */
55: public ServiceConfigurationParentLimitExceededExceptionInfo(ServiceConfigurationParentLimitExceededException serviceConfigurationParentLimitExceededException) {
56: super(Response.Status.BAD_REQUEST, serviceConfigurationParentLimitExceededException.getCode(), serviceConfigurationParentLimitExceededException);
57:
58: this.servicePid = serviceConfigurationParentLimitExceededException.getServicePid();
59: this.parentScopeId = serviceConfigurationParentLimitExceededException.getScopeId();
60: this.limitExceededBy = serviceConfigurationParentLimitExceededException.getLimitExceededBy();
61: }
62:
63: /**
64: * Gets the {@link KapuaConfigurableService} pid.
65: *
66: * @return he {@link KapuaConfigurableService} pid.
67: * @since 2.0.0
68: */
69: public String getServicePid() {
70: return servicePid;
71: }
72:
73: /**
74: * Gets the scope {@link KapuaId} for which limit has been exceeded.
75: *
76: * @return The parent scope {@link KapuaId} for which limit has been exceeded.
77: * @since 2.0.0
78: */
79: public KapuaId getParentScopeId() {
80: return parentScopeId;
81: }
82:
83: /**
84: * Gets the amount of exceed.
85: *
86: * @return the amount of exceed.
87: * @since 2.0.0
88: */
89: public long getLimitExceededBy() {
90: return limitExceededBy;
91: }
92: }