2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.pap.xacml.rest.elk.client;
23 import java.util.ArrayList;
24 import java.util.LinkedHashMap;
25 import java.util.List;
28 import org.onap.policy.rest.adapter.PolicyRestAdapter;
29 import org.onap.policy.rest.adapter.YAMLParams;
31 public class PolicyElasticData {
34 private String policyType;
35 private String configPolicyType;
36 private String configBodyData;
37 private String policyName;
38 private String policyDescription;
39 private String onapName;
40 private String configName;
41 private String configType;
42 private String jsonBody;
43 private Object jsonBodyData;
45 private Map<?, ?> serviceTypePolicyName;
46 private Map<?, ?> verticaMetrics;
47 private Map<?, ?> description;
48 private Map<?, ?> attributeFields;
51 private String policyScope;
52 private String providerComboBox;
53 private String riskType;
54 private String riskLevel;
56 private String ttlDate;
57 private Map<String, String> matching;
59 private List<Object> triggerSignatures;
60 private List<Object> symptomSignatures;
61 private String logicalConnector;
62 private String policyStatus;
63 public String gocServerScope;
64 private String supressionType;
67 private String serviceType;
69 private String location;
70 private String priority;
71 private String msLocation;
74 private String ruleName;
75 private Map<String, String> brmsParamBody;
76 private String brmsController;
77 private List<String> brmsDependency;
78 private LinkedHashMap<?, ?> ruleData;
79 private LinkedHashMap<?, ?> ruleListData;
80 private Map<String, String> drlRuleAndUIParams;
83 private String clearTimeOut;
84 private String trapMaxAge;
85 private String verificationclearTimeOut;
86 public Map<String, String> dynamicLayoutMap;
89 private String fwPolicyType;
90 private List<Object> fwattributes;
91 private String parentForChild;
92 private String securityZone;
95 private String ruleCombiningAlgId;
96 private Map<String, String> dynamicFieldConfigAttributes;
97 private Map<String, String> dynamicSettingsMap;
98 private Map<String, String> dropDownMap;
99 private String actionPerformer;
100 private String actionAttribute;
101 private List<String> dynamicRuleAlgorithmLabels;
102 private List<String> dynamicRuleAlgorithmCombo;
103 private List<String> dynamicRuleAlgorithmField1;
104 private List<String> dynamicRuleAlgorithmField2;
105 private List<Object> dynamicVariableList;
106 private List<String> dataTypeList;
107 private String actionAttributeValue;
108 private String ruleProvider;
109 private String actionBody;
110 private String actionDictHeader;
111 private String actionDictType;
112 private String actionDictUrl;
113 private String actionDictMethod;
114 private YAMLParams yamlparams;
116 public PolicyElasticData(PolicyRestAdapter policyData) {
117 this.scope = policyData.getDomainDir();
118 this.policyType = policyData.getPolicyType();
119 this.configPolicyType = policyData.getConfigPolicyType();
120 this.configBodyData = policyData.getConfigBodyData();
121 this.policyName = policyData.getNewFileName();
122 this.policyDescription = policyData.getPolicyDescription();
123 this.onapName = policyData.getOnapName();
124 this.configName = policyData.getConfigName();
125 this.configType = policyData.getConfigType();
126 this.jsonBody = policyData.getJsonBody();
127 if (configPolicyType.startsWith("ClosedLoop")) {
128 this.jsonBodyData = jsonBody;
130 this.jsonBodyData = policyData.getJsonBodyData();
133 this.serviceTypePolicyName = policyData.getServiceTypePolicyName();
134 this.verticaMetrics = policyData.getVerticaMetrics();
135 this.description = policyData.getDescription();
136 this.attributeFields = policyData.getAttributeFields();
139 this.policyScope = policyData.getPolicyScope();
140 this.providerComboBox = policyData.getProviderComboBox();
141 this.riskType = policyData.getRiskType();
142 this.riskLevel = policyData.getRiskLevel();
143 this.guard = policyData.getGuard();
144 this.ttlDate = policyData.getTtlDate();
145 this.matching = policyData.getMatching();
147 this.triggerSignatures = policyData.getTriggerSignatures();
148 this.symptomSignatures = policyData.getSymptomSignatures();
149 this.logicalConnector = policyData.getLogicalConnector();
150 this.policyStatus = policyData.getPolicyStatus();
151 this.gocServerScope = policyData.getGocServerScope();
152 this.supressionType = policyData.getSupressionType();
155 this.serviceType = policyData.getServiceType();
156 this.uuid = policyData.getUuid();
157 this.location = policyData.getLocation();
158 this.priority = policyData.getPriority();
159 this.msLocation = policyData.getMsLocation();
162 this.ruleName = policyData.getRuleName();
163 this.brmsParamBody = policyData.getBrmsParamBody();
164 this.brmsController = policyData.getBrmsController();
165 this.brmsDependency = policyData.getBrmsDependency();
166 this.ruleData = policyData.getRuleData();
167 this.ruleListData = policyData.getRuleListData();
168 this.drlRuleAndUIParams = policyData.getDrlRuleAndUIParams();
171 this.clearTimeOut = policyData.getClearTimeOut();
172 this.trapMaxAge = policyData.getTrapMaxAge();
173 this.verificationclearTimeOut = policyData.getVerificationclearTimeOut();
174 this.dynamicLayoutMap = policyData.getDynamicLayoutMap();
177 this.fwPolicyType = policyData.getFwPolicyType();
178 this.fwattributes = policyData.getFwattributes();
179 this.parentForChild = policyData.getParentForChild();
180 this.securityZone = policyData.getSecurityZone();
183 this.ruleCombiningAlgId = policyData.getRuleCombiningAlgId();
184 this.dynamicFieldConfigAttributes = policyData.getDynamicFieldConfigAttributes();
185 this.dynamicSettingsMap = policyData.getDynamicSettingsMap();
186 this.dropDownMap = policyData.getDropDownMap();
187 this.actionPerformer = policyData.getActionPerformer();
188 this.actionAttribute = policyData.getActionAttribute();
189 this.dynamicRuleAlgorithmLabels = policyData.getDynamicRuleAlgorithmLabels();
190 this.dynamicRuleAlgorithmCombo = policyData.getDynamicRuleAlgorithmCombo();
191 this.dynamicRuleAlgorithmField1 = policyData.getDynamicRuleAlgorithmField1();
192 this.dynamicRuleAlgorithmField2 = policyData.getDynamicRuleAlgorithmField2();
193 this.dynamicVariableList = policyData.getDynamicVariableList();
194 this.dataTypeList = policyData.getDataTypeList();
195 this.actionAttributeValue = policyData.getActionAttributeValue();
196 this.ruleProvider = policyData.getRuleProvider();
197 this.actionBody = policyData.getActionBody();
198 this.actionDictHeader = policyData.getActionDictHeader();
199 this.actionDictType = policyData.getActionDictType();
200 this.actionDictUrl = policyData.getActionDictUrl();
201 this.actionDictMethod = policyData.getActionDictMethod();
202 this.yamlparams = policyData.getYamlparams();
205 public String getScope() {
209 public void setScope(String scope) {
213 public String getPolicyType() {
217 public void setPolicyType(String policyType) {
218 this.policyType = policyType;
221 public String getConfigPolicyType() {
222 return configPolicyType;
225 public void setConfigPolicyType(String configPolicyType) {
226 this.configPolicyType = configPolicyType;
229 public String getConfigBodyData() {
230 return configBodyData;
233 public void setConfigBodyData(String configBodyData) {
234 this.configBodyData = configBodyData;
237 public String getPolicyName() {
241 public void setPolicyName(String policyName) {
242 this.policyName = policyName;
245 public String getPolicyDescription() {
246 return policyDescription;
249 public void setPolicyDescription(String policyDescription) {
250 this.policyDescription = policyDescription;
253 public String getOnapName() {
257 public void setOnapName(String onapName) {
258 this.onapName = onapName;
261 public String getConfigName() {
265 public void setConfigName(String configName) {
266 this.configName = configName;
269 public String getConfigType() {
273 public void setConfigType(String configType) {
274 this.configType = configType;
277 public String getJsonBody() {
281 public void setJsonBody(String jsonBody) {
282 this.jsonBody = jsonBody;
285 public Map<?, ?> getServiceTypePolicyName() {
286 return serviceTypePolicyName;
289 public void setServiceTypePolicyName(LinkedHashMap<?, ?> serviceTypePolicyName) {
290 this.serviceTypePolicyName = serviceTypePolicyName;
293 public Map<?, ?> getVerticaMetrics() {
294 return verticaMetrics;
297 public void setVerticaMetrics(LinkedHashMap<?, ?> verticaMetrics) {
298 this.verticaMetrics = verticaMetrics;
301 public Map<?, ?> getDescription() {
305 public void setDescription(Map<?, ?> description) {
306 this.description = description;
309 public Map<?, ?> getAttributeFields() {
310 return attributeFields;
313 public void setAttributeFields(LinkedHashMap<?, ?> attributeFields) {
314 this.attributeFields = attributeFields;
317 public String getPolicyScope() {
321 public void setPolicyScope(String policyScope) {
322 this.policyScope = policyScope;
325 public String getProviderComboBox() {
326 return providerComboBox;
329 public void setProviderComboBox(String providerComboBox) {
330 this.providerComboBox = providerComboBox;
333 public String getRiskType() {
337 public void setRiskType(String riskType) {
338 this.riskType = riskType;
341 public String getRiskLevel() {
345 public void setRiskLevel(String riskLevel) {
346 this.riskLevel = riskLevel;
349 public String getGuard() {
353 public void setGuard(String guard) {
357 public String getTtlDate() {
361 public void setTtlDate(String ttlDate) {
362 this.ttlDate = ttlDate;
365 public Map<String, String> getMatching() {
369 public void setMatching(Map<String, String> matching) {
370 this.matching = matching;
373 public List<Object> getTriggerSignatures() {
374 return triggerSignatures;
377 public void setTriggerSignatures(ArrayList<Object> triggerSignatures) {
378 this.triggerSignatures = triggerSignatures;
381 public List<Object> getSymptomSignatures() {
382 return symptomSignatures;
385 public void setSymptomSignatures(ArrayList<Object> symptomSignatures) {
386 this.symptomSignatures = symptomSignatures;
389 public String getLogicalConnector() {
390 return logicalConnector;
393 public void setLogicalConnector(String logicalConnector) {
394 this.logicalConnector = logicalConnector;
397 public String getPolicyStatus() {
401 public void setPolicyStatus(String policyStatus) {
402 this.policyStatus = policyStatus;
405 public String getGocServerScope() {
406 return gocServerScope;
409 public void setGocServerScope(String gocServerScope) {
410 this.gocServerScope = gocServerScope;
413 public String getSupressionType() {
414 return supressionType;
417 public void setSupressionType(String supressionType) {
418 this.supressionType = supressionType;
421 public String getServiceType() {
425 public void setServiceType(String serviceType) {
426 this.serviceType = serviceType;
429 public String getUuid() {
433 public void setUuid(String uuid) {
437 public String getLocation() {
441 public void setLocation(String location) {
442 this.location = location;
445 public String getPriority() {
449 public void setPriority(String priority) {
450 this.priority = priority;
453 public String getMsLocation() {
457 public void setMsLocation(String msLocation) {
458 this.msLocation = msLocation;
461 public String getRuleName() {
465 public void setRuleName(String ruleName) {
466 this.ruleName = ruleName;
469 public Map<String, String> getBrmsParamBody() {
470 return brmsParamBody;
473 public void setBrmsParamBody(Map<String, String> brmsParamBody) {
474 this.brmsParamBody = brmsParamBody;
477 public String getBrmsController() {
478 return brmsController;
481 public void setBrmsController(String brmsController) {
482 this.brmsController = brmsController;
485 public List<String> getBrmsDependency() {
486 return brmsDependency;
489 public void setBrmsDependency(List<String> brmsDependency) {
490 this.brmsDependency = brmsDependency;
493 public Map<?, ?> getRuleData() {
497 public void setRuleData(LinkedHashMap<?, ?> ruleData) {
498 this.ruleData = ruleData;
501 public Map<?, ?> getRuleListData() {
505 public void setRuleListData(LinkedHashMap<?, ?> ruleListData) {
506 this.ruleListData = ruleListData;
509 public Map<String, String> getDrlRuleAndUIParams() {
510 return drlRuleAndUIParams;
513 public void setDrlRuleAndUIParams(Map<String, String> drlRuleAndUIParams) {
514 this.drlRuleAndUIParams = drlRuleAndUIParams;
517 public String getClearTimeOut() {
521 public void setClearTimeOut(String clearTimeOut) {
522 this.clearTimeOut = clearTimeOut;
525 public String getTrapMaxAge() {
529 public void setTrapMaxAge(String trapMaxAge) {
530 this.trapMaxAge = trapMaxAge;
533 public String getVerificationclearTimeOut() {
534 return verificationclearTimeOut;
537 public void setVerificationclearTimeOut(String verificationclearTimeOut) {
538 this.verificationclearTimeOut = verificationclearTimeOut;
541 public Map<String, String> getDynamicLayoutMap() {
542 return dynamicLayoutMap;
545 public void setDynamicLayoutMap(Map<String, String> dynamicLayoutMap) {
546 this.dynamicLayoutMap = dynamicLayoutMap;
549 public String getFwPolicyType() {
553 public void setFwPolicyType(String fwPolicyType) {
554 this.fwPolicyType = fwPolicyType;
557 public List<Object> getFwattributes() {
561 public void setFwattributes(ArrayList<Object> fwattributes) {
562 this.fwattributes = fwattributes;
565 public String getParentForChild() {
566 return parentForChild;
569 public void setParentForChild(String parentForChild) {
570 this.parentForChild = parentForChild;
573 public String getSecurityZone() {
577 public void setSecurityZone(String securityZone) {
578 this.securityZone = securityZone;
581 public String getRuleCombiningAlgId() {
582 return ruleCombiningAlgId;
585 public void setRuleCombiningAlgId(String ruleCombiningAlgId) {
586 this.ruleCombiningAlgId = ruleCombiningAlgId;
589 public Map<String, String> getDynamicFieldConfigAttributes() {
590 return dynamicFieldConfigAttributes;
593 public void setDynamicFieldConfigAttributes(Map<String, String> dynamicFieldConfigAttributes) {
594 this.dynamicFieldConfigAttributes = dynamicFieldConfigAttributes;
597 public Map<String, String> getDynamicSettingsMap() {
598 return dynamicSettingsMap;
601 public void setDynamicSettingsMap(Map<String, String> dynamicSettingsMap) {
602 this.dynamicSettingsMap = dynamicSettingsMap;
605 public Map<String, String> getDropDownMap() {
609 public void setDropDownMap(Map<String, String> dropDownMap) {
610 this.dropDownMap = dropDownMap;
613 public String getActionPerformer() {
614 return actionPerformer;
617 public void setActionPerformer(String actionPerformer) {
618 this.actionPerformer = actionPerformer;
621 public String getActionAttribute() {
622 return actionAttribute;
625 public void setActionAttribute(String actionAttribute) {
626 this.actionAttribute = actionAttribute;
629 public List<String> getDynamicRuleAlgorithmLabels() {
630 return dynamicRuleAlgorithmLabels;
633 public void setDynamicRuleAlgorithmLabels(List<String> dynamicRuleAlgorithmLabels) {
634 this.dynamicRuleAlgorithmLabels = dynamicRuleAlgorithmLabels;
637 public List<String> getDynamicRuleAlgorithmCombo() {
638 return dynamicRuleAlgorithmCombo;
641 public void setDynamicRuleAlgorithmCombo(List<String> dynamicRuleAlgorithmCombo) {
642 this.dynamicRuleAlgorithmCombo = dynamicRuleAlgorithmCombo;
645 public List<String> getDynamicRuleAlgorithmField1() {
646 return dynamicRuleAlgorithmField1;
649 public void setDynamicRuleAlgorithmField1(List<String> dynamicRuleAlgorithmField1) {
650 this.dynamicRuleAlgorithmField1 = dynamicRuleAlgorithmField1;
653 public List<String> getDynamicRuleAlgorithmField2() {
654 return dynamicRuleAlgorithmField2;
657 public void setDynamicRuleAlgorithmField2(List<String> dynamicRuleAlgorithmField2) {
658 this.dynamicRuleAlgorithmField2 = dynamicRuleAlgorithmField2;
661 public List<Object> getDynamicVariableList() {
662 return dynamicVariableList;
665 public void setDynamicVariableList(List<Object> dynamicVariableList) {
666 this.dynamicVariableList = dynamicVariableList;
669 public List<String> getDataTypeList() {
673 public void setDataTypeList(List<String> dataTypeList) {
674 this.dataTypeList = dataTypeList;
677 public String getActionAttributeValue() {
678 return actionAttributeValue;
681 public void setActionAttributeValue(String actionAttributeValue) {
682 this.actionAttributeValue = actionAttributeValue;
685 public String getRuleProvider() {
689 public void setRuleProvider(String ruleProvider) {
690 this.ruleProvider = ruleProvider;
693 public String getActionBody() {
697 public void setActionBody(String actionBody) {
698 this.actionBody = actionBody;
701 public String getActionDictHeader() {
702 return actionDictHeader;
705 public void setActionDictHeader(String actionDictHeader) {
706 this.actionDictHeader = actionDictHeader;
709 public String getActionDictType() {
710 return actionDictType;
713 public void setActionDictType(String actionDictType) {
714 this.actionDictType = actionDictType;
717 public String getActionDictUrl() {
718 return actionDictUrl;
721 public void setActionDictUrl(String actionDictUrl) {
722 this.actionDictUrl = actionDictUrl;
725 public String getActionDictMethod() {
726 return actionDictMethod;
729 public void setActionDictMethod(String actionDictMethod) {
730 this.actionDictMethod = actionDictMethod;
733 public YAMLParams getYamlparams() {
737 public void setYamlparams(YAMLParams yamlparams) {
738 this.yamlparams = yamlparams;
741 public Object getJsonBodyData() {
745 public void setJsonBodyData(Object jsonBodyData) {
746 this.jsonBodyData = jsonBodyData;