Skip to content

Package: ServiceConfigurationLimitExceededExceptionInfo

ServiceConfigurationLimitExceededExceptionInfo

nameinstructionbranchcomplexitylinemethod
ServiceConfigurationLimitExceededExceptionInfo()
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%
ServiceConfigurationLimitExceededExceptionInfo(ServiceConfigurationLimitExceededException)
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%
getScopeId()
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.ServiceConfigurationLimitExceededException;
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 = "serviceConfigurationLimitExceededExceptionInfo")
26: @XmlAccessorType(XmlAccessType.FIELD)
27: public class ServiceConfigurationLimitExceededExceptionInfo extends ExceptionInfo {
28:
29:
30: @XmlElement(name = "servicePid")
31: private String servicePid;
32:
33: @XmlElement(name = "scopeId")
34: private KapuaId scopeId;
35:
36: @XmlElement(name = "limitExceededBy")
37: private long limitExceededBy;
38:
39: /**
40: * Constructor.
41: *
42: * @since 1.0.0
43: */
44: protected ServiceConfigurationLimitExceededExceptionInfo() {
45: super();
46: }
47:
48: /**
49: * Constructor.
50: *
51: * @param serviceConfigurationLimitExceededException The root exception.
52: * @since 1.0.0
53: */
54: public ServiceConfigurationLimitExceededExceptionInfo(ServiceConfigurationLimitExceededException serviceConfigurationLimitExceededException) {
55: super(Response.Status.BAD_REQUEST, serviceConfigurationLimitExceededException.getCode(), serviceConfigurationLimitExceededException);
56:
57: this.servicePid = serviceConfigurationLimitExceededException.getServicePid();
58: this.scopeId = serviceConfigurationLimitExceededException.getScopeId();
59: this.limitExceededBy = serviceConfigurationLimitExceededException.getLimitExceededBy();
60: }
61:
62: /**
63: * Gets the {@link KapuaConfigurableService} pid.
64: *
65: * @return he {@link KapuaConfigurableService} pid.
66: * @since 2.0.0
67: */
68: public String getServicePid() {
69: return servicePid;
70: }
71:
72: /**
73: * Gets the scope {@link KapuaId} for which limit has been exceeded.
74: *
75: * @return The scope {@link KapuaId} for which limit has been exceeded.
76: * @since 2.0.0
77: */
78: public KapuaId getScopeId() {
79: return scopeId;
80: }
81:
82: /**
83: * Gets the amount of exceed.
84: *
85: * @return the amount of exceed.
86: * @since 2.0.0
87: */
88: public long getLimitExceededBy() {
89: return limitExceededBy;
90: }
91: }