2 * ===============================LICENSE_START======================================
\r
4 * ================================================================================
\r
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============================LICENSE_END===========================================
\r
21 package org.openecomp.dcae.apod.analytics.cdap.plugins.domain.config.tca;
\r
23 import co.cask.cdap.api.annotation.Description;
\r
24 import co.cask.cdap.api.annotation.Macro;
\r
25 import com.google.common.base.Objects;
\r
26 import org.openecomp.dcae.apod.analytics.cdap.common.settings.CDAPBasePluginConfig;
\r
28 import javax.annotation.Nullable;
\r
31 * Simple TCA Plugin Configuration
\r
33 * @author Rajiv Singla . Creation Date: 2/13/2017.
\r
35 public class SimpleTCAPluginConfig extends CDAPBasePluginConfig {
\r
37 private static final long serialVersionUID = 1L;
\r
39 @Description("Field name containing VES Message")
\r
41 protected String vesMessageFieldName;
\r
43 @Description("Policy JSON that need to be applied to VES Message")
\r
45 protected String policyJson;
\r
47 @Description("Name of the output field that will contain the alert")
\r
49 protected String alertFieldName;
\r
51 @Description("Name of the output field that will contain message type: INAPPLICABLE, COMPLIANT, NON_COMPLIANT")
\r
53 protected String messageTypeFieldName;
\r
55 @Description("Specifies the output schema")
\r
56 protected String schema;
\r
58 @Description("Enables")
\r
61 protected Boolean enableAlertCEFFormat;
\r
65 * Creates an instance of TCA Plugin Configs
\r
67 * @param vesMessageFieldName Ves message field name from incoming plugin schema
\r
68 * @param policyJson TCA Policy Json String
\r
69 * @param alertFieldName Alert field name that will be added in TCA plugin output schema
\r
70 * @param messageTypeFieldName Message type field name that will be added in TCA plugin output schema
\r
71 * @param schema TCA Plugin output schema
\r
72 * @param enableAlertCEFFormat enables alert message to be formatted in VES format
\r
74 public SimpleTCAPluginConfig(final String vesMessageFieldName, final String policyJson,
\r
75 final String alertFieldName, final String messageTypeFieldName,
\r
76 final String schema, final Boolean enableAlertCEFFormat) {
\r
77 this.vesMessageFieldName = vesMessageFieldName;
\r
78 this.policyJson = policyJson;
\r
79 this.alertFieldName = alertFieldName;
\r
80 this.messageTypeFieldName = messageTypeFieldName;
\r
81 this.schema = schema;
\r
82 this.enableAlertCEFFormat = enableAlertCEFFormat;
\r
86 * Name of the field containing VES Message
\r
88 * @return VES Message field name
\r
90 public String getVesMessageFieldName() {
\r
91 return vesMessageFieldName;
\r
95 * Policy Json String
\r
97 * @return Policy Json String
\r
99 public String getPolicyJson() {
\r
105 * Alert Field name in outgoing schema
\r
107 * @return alert field name in outgoing schema
\r
109 public String getAlertFieldName() {
\r
110 return alertFieldName;
\r
114 * Returns output schema string
\r
116 * @return output schema string
\r
118 public String getSchema() {
\r
123 * Return TCA message type - INAPPLICABLE, COMPLIANT, NON_COMPLIANT
\r
125 * @return tca message type
\r
127 public String getMessageTypeFieldName() {
\r
128 return messageTypeFieldName;
\r
133 * Returns if Alert output in Common Event format
\r
135 * @return true if alert output is in common event format
\r
138 public Boolean getEnableAlertCEFFormat() {
\r
139 return enableAlertCEFFormat;
\r
143 public String toString() {
\r
144 return Objects.toStringHelper(this)
\r
145 .add("referenceName", referenceName)
\r
146 .add("vesMessageFieldName", vesMessageFieldName)
\r
147 .add("policyJson", policyJson)
\r
148 .add("alertFieldName", alertFieldName)
\r
149 .add("messageTypeFieldName", messageTypeFieldName)
\r
150 .add("schema", schema)
\r
151 .add("enableAlertCEFFormat", true)
\r