William Kurkian | 9600b5c | 2018-09-20 16:05:59 -0400 | [diff] [blame^] | 1 | /*
|
| 2 | * Copyright 2018- Cisco
|
| 3 | *
|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 | * you may not use this file except in compliance with the License.
|
| 6 | * You may obtain a copy of the License at
|
| 7 | *
|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 9 | *
|
| 10 | * Unless required by applicable law or agreed to in writing, software
|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 | * See the License for the specific language governing permissions and
|
| 14 | * limitations under the License.
|
| 15 | */
|
| 16 | package ves;
|
| 17 |
|
| 18 | import java.util.List;
|
| 19 | import java.util.Map;
|
| 20 | import java.util.ArrayList;
|
| 21 | import java.util.HashMap;
|
| 22 |
|
| 23 | public class EventFault implements VesBlock {
|
| 24 | private List<Map<String, String>> alarmAdditionalInformation;
|
| 25 | private String alarmCondition;
|
| 26 | private String eventCategory;
|
| 27 | private String eventSeverity;
|
| 28 | private String eventSourceType;
|
| 29 | private int faultFieldsVersion = 2;
|
| 30 | private String specificProblem;
|
| 31 | private String vfStatus;
|
| 32 |
|
| 33 | public EventFault(String alarmCondition, String eventCategory, String eventSeverity,
|
| 34 | String eventSourceType, String specificProblem, String vfStatus) {
|
| 35 | this.alarmCondition = alarmCondition;
|
| 36 | this.eventCategory = eventCategory;
|
| 37 | this.eventSeverity = eventSeverity;
|
| 38 | this.eventSourceType = eventSourceType;
|
| 39 | this.specificProblem = specificProblem;
|
| 40 | this.vfStatus = vfStatus;
|
| 41 | this.alarmAdditionalInformation = new ArrayList<>();
|
| 42 | }
|
| 43 |
|
| 44 | public void addAdditionalValues(String name, String value) {
|
| 45 | HashMap<String, String> newValue = new HashMap<>();
|
| 46 | newValue.put("name", name);
|
| 47 | newValue.put("value", value);
|
| 48 | this.alarmAdditionalInformation.add(newValue);
|
| 49 | }
|
| 50 |
|
| 51 | public String getName() {
|
| 52 | return "faultFields";
|
| 53 | }
|
| 54 |
|
| 55 | public Class getType() {
|
| 56 | return EventHeader.class;
|
| 57 | }
|
| 58 | |
| 59 | /** |
| 60 | * Returns value of alarmAdditionalInformation |
| 61 | * @return |
| 62 | */ |
| 63 | public List<Map<String, String>> getAlarmAdditionalInformation() { |
| 64 | return alarmAdditionalInformation; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Sets new value of alarmAdditionalInformation |
| 69 | * @param |
| 70 | */ |
| 71 | public void setAlarmAdditionalInformation(List<Map<String, String>> alarmAdditionalInformation) { |
| 72 | this.alarmAdditionalInformation = alarmAdditionalInformation; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Returns value of alarmCondition |
| 77 | * @return |
| 78 | */ |
| 79 | public String getAlarmCondition() { |
| 80 | return alarmCondition; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Sets new value of alarmCondition |
| 85 | * @param |
| 86 | */ |
| 87 | public void setAlarmCondition(String alarmCondition) { |
| 88 | this.alarmCondition = alarmCondition; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Returns value of eventCategory |
| 93 | * @return |
| 94 | */ |
| 95 | public String getEventCategory() { |
| 96 | return eventCategory; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Sets new value of eventCategory |
| 101 | * @param |
| 102 | */ |
| 103 | public void setEventCategory(String eventCategory) { |
| 104 | this.eventCategory = eventCategory; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Returns value of eventSeverity |
| 109 | * @return |
| 110 | */ |
| 111 | public String getEventSeverity() { |
| 112 | return eventSeverity; |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Sets new value of eventSeverity |
| 117 | * @param |
| 118 | */ |
| 119 | public void setEventSeverity(String eventSeverity) { |
| 120 | this.eventSeverity = eventSeverity; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Returns value of eventSourceType |
| 125 | * @return |
| 126 | */ |
| 127 | public String getEventSourceType() { |
| 128 | return eventSourceType; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Sets new value of eventSourceType |
| 133 | * @param |
| 134 | */ |
| 135 | public void setEventSourceType(String eventSourceType) { |
| 136 | this.eventSourceType = eventSourceType; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Returns value of faultFieldsVersion |
| 141 | * @return |
| 142 | */ |
| 143 | public int getFaultFieldsVersion() { |
| 144 | return faultFieldsVersion; |
| 145 | } |
| 146 | |
| 147 | /** |
| 148 | * Sets new value of faultFieldsVersion |
| 149 | * @param |
| 150 | */ |
| 151 | public void setFaultFieldsVersion(int faultFieldsVersion) { |
| 152 | this.faultFieldsVersion = faultFieldsVersion; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Returns value of specificProblem |
| 157 | * @return |
| 158 | */ |
| 159 | public String getSpecificProblem() { |
| 160 | return specificProblem; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Sets new value of specificProblem |
| 165 | * @param |
| 166 | */ |
| 167 | public void setSpecificProblem(String specificProblem) { |
| 168 | this.specificProblem = specificProblem; |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Returns value of vfStatus |
| 173 | * @return |
| 174 | */ |
| 175 | public String getVfStatus() { |
| 176 | return vfStatus; |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Sets new value of vfStatus |
| 181 | * @param |
| 182 | */ |
| 183 | public void setVfStatus(String vfStatus) { |
| 184 | this.vfStatus = vfStatus; |
| 185 | } |
| 186 | }
|