1 21 22 package org.continuent.sequoia.controller.recoverylog.events; 23 24 import java.io.Serializable ; 25 26 35 public class LogEntry implements Serializable 36 { 37 private static final long serialVersionUID = 1363084035201225164L; 38 39 private String autoConnTrans; 40 private String executionStatus; 41 private long tid; 42 private String query; 43 private String queryParams; 44 private String login; 45 private long logId; 46 private boolean escapeProcessing = false; 47 private long requestId = 0; 48 private long executionTimeInMs = 0; 49 private int updateCountResult = -1; 50 private long completionLogId = -1; 51 52 56 public static final String AUTOCOMMIT = "A"; 57 58 public static final String PERSISTENT_CONNECTION = "C"; 59 60 public static final String TRANSACTION = "T"; 61 62 63 public static final String EXECUTING = "E"; 64 65 public static final String SUCCESS = "S"; 66 67 public static final String FAILED = "F"; 68 69 public static final String UNKNOWN = "U"; 70 71 public static final String MISSING = "M"; 72 73 83 public LogEntry(long logId, String login, String query, String queryParams, 84 String autoConnTrans, long tid) 85 { 86 if (query == null) 87 throw new NullPointerException ("Invalid null query in log entry"); 88 if (login == null) 89 throw new NullPointerException ("Invalid null login in log entry"); 90 91 this.logId = logId; 92 this.login = login; 93 this.query = query; 94 this.queryParams = queryParams; 95 this.autoConnTrans = autoConnTrans; 96 this.tid = tid; 97 this.executionStatus = EXECUTING; 98 } 99 100 117 public LogEntry(long logId, String login, String query, String queryParams, 118 String autoConnTrans, long tid, boolean escapeProcessing, long requestId, 119 long executionTime, int updateCountResult) 120 { 121 this(logId, login, query, queryParams, autoConnTrans, tid, 122 escapeProcessing, requestId, executionTime); 123 this.updateCountResult = updateCountResult; 124 } 125 126 146 public LogEntry(long logId, String login, String query, String queryParams, 147 String autoConnTrans, long tid, boolean escapeProcessing, long requestId, 148 long executionTime, int updateCountResult, String status, long completionLogId) 149 { 150 this(logId, login, query, queryParams, autoConnTrans, tid, 151 escapeProcessing, requestId, executionTime, updateCountResult); 152 this.executionStatus = status; 153 this.completionLogId = completionLogId; 154 } 155 156 171 public LogEntry(long logId, String login, String query, String queryParams, 172 String autoConnTrans, long tid, boolean escapeProcessing, long requestId, 173 long executionTime) 174 { 175 this(logId, login, query, queryParams, autoConnTrans, tid); 176 this.escapeProcessing = escapeProcessing; 177 this.requestId = requestId; 178 this.executionTimeInMs = executionTime; 179 } 180 181 186 public String getAutoConnTrans() 187 { 188 return autoConnTrans; 189 } 190 191 194 public boolean getEscapeProcessing() 195 { 196 return escapeProcessing; 197 } 198 199 204 public final String getExecutionStatus() 205 { 206 return executionStatus; 207 } 208 209 214 public final void setExecutionStatus(String executionStatus) 215 { 216 this.executionStatus = executionStatus; 217 } 218 219 224 public long getExecutionTimeInMs() 225 { 226 return executionTimeInMs; 227 } 228 229 232 public long getLogId() 233 { 234 return logId; 235 } 236 237 240 public String getLogin() 241 { 242 return login; 243 } 244 245 248 public String getQuery() 249 { 250 return query; 251 } 252 253 258 public final String getQueryParams() 259 { 260 return queryParams; 261 } 262 263 268 public long getRequestId() 269 { 270 return requestId; 271 } 272 273 276 public long getTid() 277 { 278 return tid; 279 } 280 281 286 public int getUpdateCountResult() 287 { 288 return updateCountResult; 289 } 290 291 296 public final void setLogId(long logId) 297 { 298 this.logId = logId; 299 } 300 301 309 public long getCompletionLogId() 310 { 311 return completionLogId; 312 } 313 314 319 public void setCompletionLogId(long completionLogId) 320 { 321 this.completionLogId = completionLogId; 322 } 323 324 327 public String toString() 328 { 329 return "Log entry: log id" + logId + " (" + autoConnTrans 330 + ") transactionId:" + tid + " requestId:" + requestId + " vlogin:" 331 + login + " status: " + executionStatus + " sql:" + query + " params:" 332 + queryParams + " completionLogId: " + completionLogId; 333 } 334 335 } | Popular Tags |