diff options
author | Jorge Hernandez <jorge.hernandez-herrero@att.com> | 2022-02-09 19:04:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-02-09 19:04:25 +0000 |
commit | c9da04cc4ff4b133edd68ceee77f5bb5128d6574 (patch) | |
tree | 701523daabcb77f4ded20bd3dfe4c3660bb1fb90 /model/engine-model/src | |
parent | 143d9c2e74ebe962640810140aa028637af88a6c (diff) | |
parent | 59b90519eda3b95b0cfc49b6349a591c7d0c78e2 (diff) |
Merge "Remove JAXB and XML, use GSON for JSON"
Diffstat (limited to 'model/engine-model/src')
5 files changed, 7 insertions, 58 deletions
diff --git a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineModel.java b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineModel.java index 97e85c596..1a590a411 100644 --- a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineModel.java +++ b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineModel.java @@ -24,11 +24,6 @@ package org.onap.policy.apex.model.enginemodel.concepts; import java.text.SimpleDateFormat; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxConcept; import org.onap.policy.apex.model.basicmodel.concepts.AxKey; @@ -53,20 +48,12 @@ import org.onap.policy.common.utils.validation.Assertions; * <p>Validation checks that the current state {@link AxEngineState} is defined and that the time stamp * is set on the engine model. */ -@XmlRootElement(name = "apexEngineModel", namespace = "http://www.onap.org/policy/apex-pdp") -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "AxEngineModel", namespace = "http://www.onap.org/policy/apex-pdp", - propOrder = {"timestamp", "state", "stats"}) - public class AxEngineModel extends AxContextModel { private static final long serialVersionUID = 6381235864606564046L; private static final int HASH_CODE_PRIME = 32; private long timestamp; - - @XmlElement(required = true) private AxEngineState state; - private AxEngineStats stats; /** diff --git a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineState.java b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineState.java index 63c8706d2..24c564b96 100644 --- a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineState.java +++ b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineState.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. + * Modifications Copyright (C) 2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,18 +22,12 @@ package org.onap.policy.apex.model.enginemodel.concepts; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - /** * This enumeration indicates the execution state of an Apex engine. * * @author Liam Fallon (liam.fallon@ericsson.com) */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "AxEngineState", namespace = "http://www.onap.org/policy/apex-pdp") public enum AxEngineState { /** The state of the engine is not known. */ UNDEFINED(0), @@ -54,4 +49,4 @@ public enum AxEngineState { public int getStateIdentifier() { return stateIdentifier; } -}
\ No newline at end of file +} diff --git a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java index af5e8d458..36df645a5 100644 --- a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java +++ b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java @@ -26,11 +26,6 @@ import io.prometheus.client.Gauge; import io.prometheus.client.Histogram; import java.text.SimpleDateFormat; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; import lombok.Getter; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxConcept; @@ -47,10 +42,6 @@ import org.onap.policy.common.utils.validation.Assertions; * engine, and the time stamp of the last engine start are recorded. */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name = "apexEngineStats", namespace = "http://www.onap.org/policy/apex-pdp") -@XmlType(name = "AxEngineStats", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = {"key", "timeStamp", - "eventCount", "lastExecutionTime", "averageExecutionTime", "upTime", "lastStart"}) public class AxEngineStats extends AxConcept { private static final long serialVersionUID = -6981129081962785368L; private static final int HASH_CODE_PRIME = 32; @@ -71,28 +62,15 @@ public class AxEngineStats extends AxConcept { .name("apex_engine_last_execution_time").labelNames(ENGINE_INSTANCE_ID) .help("Time taken to execute the last APEX policy in seconds.").register(); - @XmlElement(name = "key", required = true) private AxReferenceKey key; - - @XmlElement(required = true) private long timeStamp; - - @XmlElement(required = true) private long eventCount; - - @XmlElement(required = true) private long lastExecutionTime; - - @XmlElement(required = true) private double averageExecutionTime; - - @XmlElement(required = true) private long upTime; @Getter private transient long lastEnterTime; - - @XmlElement(required = true) private long lastStart; /** diff --git a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/package-info.java b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/package-info.java index ea47c6993..4557af7db 100644 --- a/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/package-info.java +++ b/model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/package-info.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -21,14 +22,7 @@ /** * Contains the concepts required to receive state information and statistcs from running APEX * engines. - * + * * @author Liam Fallon (liam.fallon@ericsson.com) */ -@XmlSchema(namespace = "http://www.onap.org/policy/apex-pdp", elementFormDefault = XmlNsForm.QUALIFIED, - xmlns = {@XmlNs(namespaceURI = "http://www.onap.org/policy/apex-pdp", prefix = "")}) - package org.onap.policy.apex.model.enginemodel.concepts; - -import javax.xml.bind.annotation.XmlNs; -import javax.xml.bind.annotation.XmlNsForm; -import javax.xml.bind.annotation.XmlSchema; diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java index 8baa59b2f..e7fdd2d93 100644 --- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java +++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java @@ -75,11 +75,6 @@ public class ApexEngineModelTest { } @Test - public void testModelWriteReadXml() throws Exception { - testApexModel.testApexModelWriteReadXml(); - } - - @Test public void testModelWriteReadJson() throws Exception { testApexModel.testApexModelWriteReadJson(); } |