2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 package org.onap.clamp.clds.model.prop;
26 import com.att.eelf.configuration.EELFLogger;
27 import com.att.eelf.configuration.EELFManager;
28 import com.fasterxml.jackson.databind.JsonNode;
31 * Parse Tca Threshhold json properties.
34 * {"TCA_0lm6cix":{"Narra":[{"name":"tname","value":"Narra"},{"name":"tcaEnab",
35 * "value":"on"},{"name":"tcaPol","value":"Polcicy1"},{"name":"tcaPolId","value"
36 * :"1"},{"name":"tcaInt","value":"1"},{"name":"tcaSev","value":"Critical"},{
37 * "name":"tcaVio","value":"1"},{"serviceConfigurations":[["FIELDPATH_test_1",
38 * ">","4"],["FIELDPATH_test_1","=","5"]]}],"Srini":[{"name":"tname","value":
39 * "Srini"},{"name":"tcaEnab","value":"on"},{"name":"tcaPol","value":"Policy1"},
40 * {"name":"tcaPolId","value":"1"},{"name":"tcaInt","value":"1"},{"name":
41 * "tcaSev","value":"Major"},{"name":"tcaVio","value":"1"},{
42 * "serviceConfigurations":[["FIELDPATH_test_2","=","3"],["FIELDPATH_test_1",">"
47 public class TcaThreshhold {
49 protected static final EELFLogger logger = EELFManager.getInstance().getLogger(TcaThreshhold.class);
50 protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
52 private String metric;
53 private String fieldPath;
54 private String operator;
55 private Integer threshhold;
58 * Parse Tca Threshhold given json node
62 public TcaThreshhold(JsonNode node) {
64 if (node.get(0) != null) {
65 metric = node.get(0).asText();
67 if (node.get(1) != null) {
68 operator = node.get(1).asText();
70 if (node.get(2) != null) {
71 threshhold = Integer.valueOf(node.get(2).asText());
73 if (node.get(3) != null) {
74 fieldPath = node.get(3).asText();
78 public String getMetric() {
82 public void setMetric(String metric) {
86 public String getFieldPath() {
90 public void setFieldPath(String fieldPath) {
91 this.fieldPath = fieldPath;
94 public String getOperator() {
98 public void setOperator(String operator) {
99 this.operator = operator;
102 public Integer getThreshhold() {
106 public void setThreshhold(Integer threshhold) {
107 this.threshhold = threshhold;