awips2/edexOsgi/com.raytheon.uf.common.event/src/com/raytheon/uf/common/event/Event.java
Brad Gonzales 5257f9a81a Issue #1305 updated ProcessEvent with quantitative statistics. removed duplicate processStats.properties.
Amend:
   removed groupBy attribute "fileName"
   added LogLevel enum and attribute to Event.java.  Default level is DEBUG.

Change-Id: I13c155b1fae19cf5a3c82fbb633bf6c7fb217c07

Former-commit-id: cbce70fd0b [formerly 6ddd1cbdb3] [formerly a4bc175653 [formerly 51802e671ac15d451fec19262dfa7a352f0e4c09]]
Former-commit-id: a4bc175653
Former-commit-id: ce47edb905
2012-11-06 07:31:19 -06:00

91 lines
No EOL
1.9 KiB
Java

package com.raytheon.uf.common.event;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.persistence.Column;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* Provides logging and deletion services for camel
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 5, 2012 #1305 bgonzale Added LogLevel enum and transient attribute.
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public abstract class Event implements Serializable, ISerializableObject {
private static final long serialVersionUID = 1L;
public enum LogLevel {
DEBUG, INFO, WARN, ERROR, FATAL, ALL, OFF, TRACE
}
@Column
@DynamicSerializeElement
protected Calendar date;
@Column
@DynamicSerializeElement
protected String id;
@DynamicSerializeElement
protected LogLevel logLevel;
public Event() {
this(LogLevel.DEBUG);
}
public Event(LogLevel logLevel) {
date = Calendar.getInstance();
this.logLevel = logLevel;
}
public Calendar getDate() {
return date;
}
public void setDate(Calendar date) {
this.date = date;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String toString() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-d hh:mm:ss");
return formatter.format(date.getTime()) + " Id: " + id;
}
/**
* @return the logLevel
*/
public LogLevel getLogLevel() {
return logLevel;
}
/**
* @param logLevel
* the logLevel to set
*/
public void setLogLevel(LogLevel logLevel) {
this.logLevel = logLevel;
}
}