Consolidate PolicyRestAdapter setup
[policy/engine.git] / ONAP-PAP-REST / src / main / java / org / onap / policy / pap / xacml / rest / elk / client / PolicyElasticData.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP-PAP-REST
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.policy.pap.xacml.rest.elk.client;
22
23 import java.util.ArrayList;
24 import java.util.LinkedHashMap;
25 import java.util.List;
26 import java.util.Map;
27
28 import org.onap.policy.rest.adapter.PolicyRestAdapter;
29 import org.onap.policy.rest.adapter.YAMLParams;
30
31 public class PolicyElasticData {
32
33     private String scope;
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;
44
45     private Map<?, ?> serviceTypePolicyName;
46     private Map<?, ?> verticaMetrics;
47     private Map<?, ?> description;
48     private Map<?, ?> attributeFields;
49
50     // Safe Policy
51     private String policyScope;
52     private String providerComboBox;
53     private String riskType;
54     private String riskLevel;
55     private String guard;
56     private String ttlDate;
57     private Map<String, String> matching;
58
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;
65
66     // MicroSerice
67     private String serviceType;
68     private String uuid;
69     private String location;
70     private String priority;
71     private String msLocation;
72
73     // BRMS Policies
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;
81
82     // ClosedLoop
83     private String clearTimeOut;
84     private String trapMaxAge;
85     private String verificationclearTimeOut;
86     public Map<String, String> dynamicLayoutMap;
87
88     // FireWall
89     private String fwPolicyType;
90     private List<Object> fwattributes;
91     private String parentForChild;
92     private String securityZone;
93
94     // Action & Decision
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;
115
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;
129         } else {
130             this.jsonBodyData = policyData.getJsonBodyData();
131         }
132
133         this.serviceTypePolicyName = policyData.getServiceTypePolicyName();
134         this.verticaMetrics = policyData.getVerticaMetrics();
135         this.description = policyData.getDescription();
136         this.attributeFields = policyData.getAttributeFields();
137
138         // Safe Policy
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();
146
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();
153
154         // MicroSerice
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();
160
161         // BRMS Policies
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();
169
170         // ClosedLoop
171         this.clearTimeOut = policyData.getClearTimeOut();
172         this.trapMaxAge = policyData.getTrapMaxAge();
173         this.verificationclearTimeOut = policyData.getVerificationclearTimeOut();
174         this.dynamicLayoutMap = policyData.getDynamicLayoutMap();
175
176         // FireWall
177         this.fwPolicyType = policyData.getFwPolicyType();
178         this.fwattributes = policyData.getFwattributes();
179         this.parentForChild = policyData.getParentForChild();
180         this.securityZone = policyData.getSecurityZone();
181
182         // Action & Decision
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();
203     }
204
205     public String getScope() {
206         return scope;
207     }
208
209     public void setScope(String scope) {
210         this.scope = scope;
211     }
212
213     public String getPolicyType() {
214         return policyType;
215     }
216
217     public void setPolicyType(String policyType) {
218         this.policyType = policyType;
219     }
220
221     public String getConfigPolicyType() {
222         return configPolicyType;
223     }
224
225     public void setConfigPolicyType(String configPolicyType) {
226         this.configPolicyType = configPolicyType;
227     }
228
229     public String getConfigBodyData() {
230         return configBodyData;
231     }
232
233     public void setConfigBodyData(String configBodyData) {
234         this.configBodyData = configBodyData;
235     }
236
237     public String getPolicyName() {
238         return policyName;
239     }
240
241     public void setPolicyName(String policyName) {
242         this.policyName = policyName;
243     }
244
245     public String getPolicyDescription() {
246         return policyDescription;
247     }
248
249     public void setPolicyDescription(String policyDescription) {
250         this.policyDescription = policyDescription;
251     }
252
253     public String getOnapName() {
254         return onapName;
255     }
256
257     public void setOnapName(String onapName) {
258         this.onapName = onapName;
259     }
260
261     public String getConfigName() {
262         return configName;
263     }
264
265     public void setConfigName(String configName) {
266         this.configName = configName;
267     }
268
269     public String getConfigType() {
270         return configType;
271     }
272
273     public void setConfigType(String configType) {
274         this.configType = configType;
275     }
276
277     public String getJsonBody() {
278         return jsonBody;
279     }
280
281     public void setJsonBody(String jsonBody) {
282         this.jsonBody = jsonBody;
283     }
284
285     public Map<?, ?> getServiceTypePolicyName() {
286         return serviceTypePolicyName;
287     }
288
289     public void setServiceTypePolicyName(LinkedHashMap<?, ?> serviceTypePolicyName) {
290         this.serviceTypePolicyName = serviceTypePolicyName;
291     }
292
293     public Map<?, ?> getVerticaMetrics() {
294         return verticaMetrics;
295     }
296
297     public void setVerticaMetrics(LinkedHashMap<?, ?> verticaMetrics) {
298         this.verticaMetrics = verticaMetrics;
299     }
300
301     public Map<?, ?> getDescription() {
302         return description;
303     }
304
305     public void setDescription(Map<?, ?> description) {
306         this.description = description;
307     }
308
309     public Map<?, ?> getAttributeFields() {
310         return attributeFields;
311     }
312
313     public void setAttributeFields(LinkedHashMap<?, ?> attributeFields) {
314         this.attributeFields = attributeFields;
315     }
316
317     public String getPolicyScope() {
318         return policyScope;
319     }
320
321     public void setPolicyScope(String policyScope) {
322         this.policyScope = policyScope;
323     }
324
325     public String getProviderComboBox() {
326         return providerComboBox;
327     }
328
329     public void setProviderComboBox(String providerComboBox) {
330         this.providerComboBox = providerComboBox;
331     }
332
333     public String getRiskType() {
334         return riskType;
335     }
336
337     public void setRiskType(String riskType) {
338         this.riskType = riskType;
339     }
340
341     public String getRiskLevel() {
342         return riskLevel;
343     }
344
345     public void setRiskLevel(String riskLevel) {
346         this.riskLevel = riskLevel;
347     }
348
349     public String getGuard() {
350         return guard;
351     }
352
353     public void setGuard(String guard) {
354         this.guard = guard;
355     }
356
357     public String getTtlDate() {
358         return ttlDate;
359     }
360
361     public void setTtlDate(String ttlDate) {
362         this.ttlDate = ttlDate;
363     }
364
365     public Map<String, String> getMatching() {
366         return matching;
367     }
368
369     public void setMatching(Map<String, String> matching) {
370         this.matching = matching;
371     }
372
373     public List<Object> getTriggerSignatures() {
374         return triggerSignatures;
375     }
376
377     public void setTriggerSignatures(ArrayList<Object> triggerSignatures) {
378         this.triggerSignatures = triggerSignatures;
379     }
380
381     public List<Object> getSymptomSignatures() {
382         return symptomSignatures;
383     }
384
385     public void setSymptomSignatures(ArrayList<Object> symptomSignatures) {
386         this.symptomSignatures = symptomSignatures;
387     }
388
389     public String getLogicalConnector() {
390         return logicalConnector;
391     }
392
393     public void setLogicalConnector(String logicalConnector) {
394         this.logicalConnector = logicalConnector;
395     }
396
397     public String getPolicyStatus() {
398         return policyStatus;
399     }
400
401     public void setPolicyStatus(String policyStatus) {
402         this.policyStatus = policyStatus;
403     }
404
405     public String getGocServerScope() {
406         return gocServerScope;
407     }
408
409     public void setGocServerScope(String gocServerScope) {
410         this.gocServerScope = gocServerScope;
411     }
412
413     public String getSupressionType() {
414         return supressionType;
415     }
416
417     public void setSupressionType(String supressionType) {
418         this.supressionType = supressionType;
419     }
420
421     public String getServiceType() {
422         return serviceType;
423     }
424
425     public void setServiceType(String serviceType) {
426         this.serviceType = serviceType;
427     }
428
429     public String getUuid() {
430         return uuid;
431     }
432
433     public void setUuid(String uuid) {
434         this.uuid = uuid;
435     }
436
437     public String getLocation() {
438         return location;
439     }
440
441     public void setLocation(String location) {
442         this.location = location;
443     }
444
445     public String getPriority() {
446         return priority;
447     }
448
449     public void setPriority(String priority) {
450         this.priority = priority;
451     }
452
453     public String getMsLocation() {
454         return msLocation;
455     }
456
457     public void setMsLocation(String msLocation) {
458         this.msLocation = msLocation;
459     }
460
461     public String getRuleName() {
462         return ruleName;
463     }
464
465     public void setRuleName(String ruleName) {
466         this.ruleName = ruleName;
467     }
468
469     public Map<String, String> getBrmsParamBody() {
470         return brmsParamBody;
471     }
472
473     public void setBrmsParamBody(Map<String, String> brmsParamBody) {
474         this.brmsParamBody = brmsParamBody;
475     }
476
477     public String getBrmsController() {
478         return brmsController;
479     }
480
481     public void setBrmsController(String brmsController) {
482         this.brmsController = brmsController;
483     }
484
485     public List<String> getBrmsDependency() {
486         return brmsDependency;
487     }
488
489     public void setBrmsDependency(List<String> brmsDependency) {
490         this.brmsDependency = brmsDependency;
491     }
492
493     public Map<?, ?> getRuleData() {
494         return ruleData;
495     }
496
497     public void setRuleData(LinkedHashMap<?, ?> ruleData) {
498         this.ruleData = ruleData;
499     }
500
501     public Map<?, ?> getRuleListData() {
502         return ruleListData;
503     }
504
505     public void setRuleListData(LinkedHashMap<?, ?> ruleListData) {
506         this.ruleListData = ruleListData;
507     }
508
509     public Map<String, String> getDrlRuleAndUIParams() {
510         return drlRuleAndUIParams;
511     }
512
513     public void setDrlRuleAndUIParams(Map<String, String> drlRuleAndUIParams) {
514         this.drlRuleAndUIParams = drlRuleAndUIParams;
515     }
516
517     public String getClearTimeOut() {
518         return clearTimeOut;
519     }
520
521     public void setClearTimeOut(String clearTimeOut) {
522         this.clearTimeOut = clearTimeOut;
523     }
524
525     public String getTrapMaxAge() {
526         return trapMaxAge;
527     }
528
529     public void setTrapMaxAge(String trapMaxAge) {
530         this.trapMaxAge = trapMaxAge;
531     }
532
533     public String getVerificationclearTimeOut() {
534         return verificationclearTimeOut;
535     }
536
537     public void setVerificationclearTimeOut(String verificationclearTimeOut) {
538         this.verificationclearTimeOut = verificationclearTimeOut;
539     }
540
541     public Map<String, String> getDynamicLayoutMap() {
542         return dynamicLayoutMap;
543     }
544
545     public void setDynamicLayoutMap(Map<String, String> dynamicLayoutMap) {
546         this.dynamicLayoutMap = dynamicLayoutMap;
547     }
548
549     public String getFwPolicyType() {
550         return fwPolicyType;
551     }
552
553     public void setFwPolicyType(String fwPolicyType) {
554         this.fwPolicyType = fwPolicyType;
555     }
556
557     public List<Object> getFwattributes() {
558         return fwattributes;
559     }
560
561     public void setFwattributes(ArrayList<Object> fwattributes) {
562         this.fwattributes = fwattributes;
563     }
564
565     public String getParentForChild() {
566         return parentForChild;
567     }
568
569     public void setParentForChild(String parentForChild) {
570         this.parentForChild = parentForChild;
571     }
572
573     public String getSecurityZone() {
574         return securityZone;
575     }
576
577     public void setSecurityZone(String securityZone) {
578         this.securityZone = securityZone;
579     }
580
581     public String getRuleCombiningAlgId() {
582         return ruleCombiningAlgId;
583     }
584
585     public void setRuleCombiningAlgId(String ruleCombiningAlgId) {
586         this.ruleCombiningAlgId = ruleCombiningAlgId;
587     }
588
589     public Map<String, String> getDynamicFieldConfigAttributes() {
590         return dynamicFieldConfigAttributes;
591     }
592
593     public void setDynamicFieldConfigAttributes(Map<String, String> dynamicFieldConfigAttributes) {
594         this.dynamicFieldConfigAttributes = dynamicFieldConfigAttributes;
595     }
596
597     public Map<String, String> getDynamicSettingsMap() {
598         return dynamicSettingsMap;
599     }
600
601     public void setDynamicSettingsMap(Map<String, String> dynamicSettingsMap) {
602         this.dynamicSettingsMap = dynamicSettingsMap;
603     }
604
605     public Map<String, String> getDropDownMap() {
606         return dropDownMap;
607     }
608
609     public void setDropDownMap(Map<String, String> dropDownMap) {
610         this.dropDownMap = dropDownMap;
611     }
612
613     public String getActionPerformer() {
614         return actionPerformer;
615     }
616
617     public void setActionPerformer(String actionPerformer) {
618         this.actionPerformer = actionPerformer;
619     }
620
621     public String getActionAttribute() {
622         return actionAttribute;
623     }
624
625     public void setActionAttribute(String actionAttribute) {
626         this.actionAttribute = actionAttribute;
627     }
628
629     public List<String> getDynamicRuleAlgorithmLabels() {
630         return dynamicRuleAlgorithmLabels;
631     }
632
633     public void setDynamicRuleAlgorithmLabels(List<String> dynamicRuleAlgorithmLabels) {
634         this.dynamicRuleAlgorithmLabels = dynamicRuleAlgorithmLabels;
635     }
636
637     public List<String> getDynamicRuleAlgorithmCombo() {
638         return dynamicRuleAlgorithmCombo;
639     }
640
641     public void setDynamicRuleAlgorithmCombo(List<String> dynamicRuleAlgorithmCombo) {
642         this.dynamicRuleAlgorithmCombo = dynamicRuleAlgorithmCombo;
643     }
644
645     public List<String> getDynamicRuleAlgorithmField1() {
646         return dynamicRuleAlgorithmField1;
647     }
648
649     public void setDynamicRuleAlgorithmField1(List<String> dynamicRuleAlgorithmField1) {
650         this.dynamicRuleAlgorithmField1 = dynamicRuleAlgorithmField1;
651     }
652
653     public List<String> getDynamicRuleAlgorithmField2() {
654         return dynamicRuleAlgorithmField2;
655     }
656
657     public void setDynamicRuleAlgorithmField2(List<String> dynamicRuleAlgorithmField2) {
658         this.dynamicRuleAlgorithmField2 = dynamicRuleAlgorithmField2;
659     }
660
661     public List<Object> getDynamicVariableList() {
662         return dynamicVariableList;
663     }
664
665     public void setDynamicVariableList(List<Object> dynamicVariableList) {
666         this.dynamicVariableList = dynamicVariableList;
667     }
668
669     public List<String> getDataTypeList() {
670         return dataTypeList;
671     }
672
673     public void setDataTypeList(List<String> dataTypeList) {
674         this.dataTypeList = dataTypeList;
675     }
676
677     public String getActionAttributeValue() {
678         return actionAttributeValue;
679     }
680
681     public void setActionAttributeValue(String actionAttributeValue) {
682         this.actionAttributeValue = actionAttributeValue;
683     }
684
685     public String getRuleProvider() {
686         return ruleProvider;
687     }
688
689     public void setRuleProvider(String ruleProvider) {
690         this.ruleProvider = ruleProvider;
691     }
692
693     public String getActionBody() {
694         return actionBody;
695     }
696
697     public void setActionBody(String actionBody) {
698         this.actionBody = actionBody;
699     }
700
701     public String getActionDictHeader() {
702         return actionDictHeader;
703     }
704
705     public void setActionDictHeader(String actionDictHeader) {
706         this.actionDictHeader = actionDictHeader;
707     }
708
709     public String getActionDictType() {
710         return actionDictType;
711     }
712
713     public void setActionDictType(String actionDictType) {
714         this.actionDictType = actionDictType;
715     }
716
717     public String getActionDictUrl() {
718         return actionDictUrl;
719     }
720
721     public void setActionDictUrl(String actionDictUrl) {
722         this.actionDictUrl = actionDictUrl;
723     }
724
725     public String getActionDictMethod() {
726         return actionDictMethod;
727     }
728
729     public void setActionDictMethod(String actionDictMethod) {
730         this.actionDictMethod = actionDictMethod;
731     }
732
733     public YAMLParams getYamlparams() {
734         return yamlparams;
735     }
736
737     public void setYamlparams(YAMLParams yamlparams) {
738         this.yamlparams = yamlparams;
739     }
740
741     public Object getJsonBodyData() {
742         return jsonBodyData;
743     }
744
745     public void setJsonBodyData(Object jsonBodyData) {
746         this.jsonBodyData = jsonBodyData;
747     }
748 }