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