001/** 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019package org.apache.oozie.client.rest; 020 021import java.util.Date; 022 023import javax.persistence.Basic; 024import javax.persistence.Column; 025import javax.persistence.DiscriminatorColumn; 026import javax.persistence.DiscriminatorType; 027import javax.persistence.Entity; 028import javax.persistence.GeneratedValue; 029import javax.persistence.GenerationType; 030import javax.persistence.Id; 031import javax.persistence.Lob; 032import javax.persistence.SequenceGenerator; 033import javax.persistence.Table; 034import javax.persistence.Transient; 035 036import org.apache.oozie.client.SLAEvent; 037import org.json.simple.JSONObject; 038 039@Deprecated 040@Entity 041@Table(name = "SLA_EVENTS") 042@DiscriminatorColumn(name = "bean_type", discriminatorType = DiscriminatorType.STRING) 043public class JsonSLAEvent implements SLAEvent, JsonBean { 044 // Primary key 045 @Id 046 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EVENT_SEQ") 047 @SequenceGenerator(name = "EVENT_SEQ", sequenceName = "EVENT_SEQ", initialValue = 1, allocationSize = 50) 048 private long event_id; 049 050 @Basic 051 @Column(name = "sla_id") 052 private String slaId; 053 054 @Transient 055 private SlaAppType appType = null; 056 057 @Basic 058 @Column(name = "app_name") 059 private String appName = null; 060 061 @Basic 062 @Column(name = "user_name") 063 private String user = null; 064 065 @Basic 066 @Column(name = "group_name") 067 private String groupName = null; 068 069 @Basic 070 @Column(name = "parent_client_id") 071 private String parentClientId = null; 072 073 @Basic 074 @Column(name = "parent_sla_id") 075 private String parentSlaId = null; 076 077 @Transient 078 private Date expectedStart = null; 079 080 @Transient 081 private Date expectedEnd = null; 082 083 @Transient 084 private Date statusTimestamp = null; 085 086 @Column(name = "notification_msg") 087 @Lob 088 private String notificationMsg = null; 089 090 @Basic 091 @Column(name = "alert_contact") 092 private String alertContact = null; 093 094 @Basic 095 @Column(name = "dev_contact") 096 private String devContact = null; 097 098 @Basic 099 @Column(name = "qa_contact") 100 private String qaContact = null; 101 102 @Basic 103 @Column(name = "se_contact") 104 private String seContact = null; 105 106 @Basic 107 @Column(name = "alert_frequency") 108 private String alertFrequency = null; 109 110 @Basic 111 @Column(name = "alert_percentage") 112 private String alertPercentage = null; 113 114 @Column(name = "upstream_apps") 115 @Lob 116 private String upstreamApps = null; 117 118 @Transient 119 private Status jobStatus = null; 120 121 @Column(name = "job_data") 122 @Lob 123 private String jobData = null; 124 125 public long getEvent_id() { 126 return event_id; 127 } 128 129 public void setEvent_id(long id) { 130 this.event_id = id; 131 } 132 133 public String getSlaId() { 134 return slaId; 135 } 136 137 public void setSlaId(String slaId) { 138 this.slaId = slaId; 139 } 140 141 /* 142 * public String getClientId() { return clientId; } 143 * 144 * public void setClientId(String clientId) { this.clientId = clientId; } 145 */ 146 public SlaAppType getAppType() { 147 return appType; 148 } 149 150 public void setAppType(SlaAppType appType) { 151 this.appType = appType; 152 } 153 154 public String getAppName() { 155 return appName; 156 } 157 158 public void setAppName(String appName) { 159 this.appName = appName; 160 } 161 162 public String getUser() { 163 return user; 164 } 165 166 public void setUser(String user) { 167 this.user = user; 168 } 169 170 public String getGroupName() { 171 return groupName; 172 } 173 174 public void setGroupName(String groupName) { 175 this.groupName = groupName; 176 } 177 178 public String getParentClientId() { 179 return parentClientId; 180 } 181 182 public void setParentClientId(String parentClientId) { 183 this.parentClientId = parentClientId; 184 } 185 186 public String getParentSlaId() { 187 return parentSlaId; 188 } 189 190 public void setParentSlaId(String parentSlaId) { 191 this.parentSlaId = parentSlaId; 192 } 193 194 public Date getExpectedStart() { 195 return expectedStart; 196 } 197 198 public void setExpectedStart(Date expectedStart) { 199 this.expectedStart = expectedStart; 200 } 201 202 public Date getExpectedEnd() { 203 return expectedEnd; 204 } 205 206 public void setExpectedEnd(Date expectedEnd) { 207 this.expectedEnd = expectedEnd; 208 } 209 210 public Date getStatusTimestamp() { 211 return statusTimestamp; 212 } 213 214 public void setStatusTimestamp(Date statusTimestamp) { 215 this.statusTimestamp = statusTimestamp; 216 } 217 218 public String getNotificationMsg() { 219 return notificationMsg; 220 } 221 222 public void setNotificationMsg(String notificationMsg) { 223 this.notificationMsg = notificationMsg; 224 } 225 226 public String getAlertContact() { 227 return alertContact; 228 } 229 230 public void setAlertContact(String alertContact) { 231 this.alertContact = alertContact; 232 } 233 234 public String getDevContact() { 235 return devContact; 236 } 237 238 public void setDevContact(String devContact) { 239 this.devContact = devContact; 240 } 241 242 public String getQaContact() { 243 return qaContact; 244 } 245 246 public void setQaContact(String qaContact) { 247 this.qaContact = qaContact; 248 } 249 250 public String getSeContact() { 251 return seContact; 252 } 253 254 public void setSeContact(String seContact) { 255 this.seContact = seContact; 256 } 257 258 public String getAlertFrequency() { 259 return alertFrequency; 260 } 261 262 public void setAlertFrequency(String alertFrequency) { 263 this.alertFrequency = alertFrequency; 264 } 265 266 public String getAlertPercentage() { 267 return alertPercentage; 268 } 269 270 public void setAlertPercentage(String alertPercentage) { 271 this.alertPercentage = alertPercentage; 272 } 273 274 public String getUpstreamApps() { 275 return upstreamApps; 276 } 277 278 public void setUpstreamApps(String upstreamApps) { 279 this.upstreamApps = upstreamApps; 280 } 281 282 public Status getJobStatus() { 283 return jobStatus; 284 } 285 286 public void setJobStatus(Status jobStatus) { 287 this.jobStatus = jobStatus; 288 } 289 290 public String getJobData() { 291 return jobData; 292 } 293 294 public void setJobData(String jobData) { 295 this.jobData = jobData; 296 } 297 298 @Override 299 public JSONObject toJSONObject() { 300 // TODO Auto-generated method stub 301 return null; 302 } 303 304 @SuppressWarnings("unchecked") 305 public JSONObject toJSONObject(String timeZoneId) { 306 return null; 307 } 308 309 public JsonSLAEvent() { 310 311 } 312 313 @SuppressWarnings("unchecked") 314 public JsonSLAEvent(JSONObject json) { 315 316 } 317 318}