1 package org.onap.clamp.clds.model.prop;
3 import java.util.logging.Logger;
5 import com.fasterxml.jackson.databind.JsonNode;
8 * Parse Tca Threshhold json properties.
10 * Example json: {"TCA_0lm6cix":{"Narra":[{"name":"tname","value":"Narra"},{"name":"tcaEnab","value":"on"},{"name":"tcaPol","value":"Polcicy1"},{"name":"tcaPolId","value":"1"},{"name":"tcaInt","value":"1"},{"name":"tcaSev","value":"Critical"},{"name":"tcaVio","value":"1"},{"serviceConfigurations":[["FIELDPATH_test_1",">","4"],["FIELDPATH_test_1","=","5"]]}],"Srini":[{"name":"tname","value":"Srini"},{"name":"tcaEnab","value":"on"},{"name":"tcaPol","value":"Policy1"},{"name":"tcaPolId","value":"1"},{"name":"tcaInt","value":"1"},{"name":"tcaSev","value":"Major"},{"name":"tcaVio","value":"1"},{"serviceConfigurations":[["FIELDPATH_test_2","=","3"],["FIELDPATH_test_1",">","2"]]}]}}
14 public class TcaThreshhold {
16 private static final Logger logger = Logger.getLogger(TcaThreshhold.class.getName());
18 private String metric;
19 private String fieldPath;
20 private String operator;
21 private Integer threshhold;
24 * Parse Tca Threshhold given json node
28 public TcaThreshhold(JsonNode node) {
30 if(node.get(0) != null){
31 metric = node.get(0).asText();
33 if(node.get(1) != null){
34 operator = node.get(1).asText();
36 if(node.get(2) != null){
37 threshhold = Integer.valueOf(node.get(2).asText());
39 if(node.get(3) != null){
40 fieldPath = node.get(3).asText();
44 public String getMetric() {
48 public void setMetric(String metric) {
52 public String getFieldPath() {
56 public void setFieldPath(String fieldPath) {
57 this.fieldPath = fieldPath;
60 public String getOperator() {
64 public void setOperator(String operator) {
65 this.operator = operator;
68 public Integer getThreshhold() {
72 public void setThreshhold(Integer threshhold) {
73 this.threshhold = threshhold;