All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cl.alma.camel.acslog.ACSLogEntryWrapper Maven / Gradle / Ivy

There is a newer version: 1.0.10
Show newest version
package cl.alma.camel.acslog;

import com.cosylab.logging.engine.log.ILogEntry;
import com.cosylab.logging.engine.log.LogEntry;
import com.cosylab.logging.engine.log.LogField;
import com.cosylab.logging.engine.log.LogTypeHelper;

public class ACSLogEntryWrapper extends LogEntry {
	
	private String origin = "";
	private String uid = "";
	
	public ACSLogEntryWrapper(ILogEntry logEntry, String origin, String log_preuid) {
		super(
			(Long)logEntry.getField(LogField.TIMESTAMP), 
			((LogTypeHelper)logEntry.getField(LogField.ENTRYTYPE)).ordinal(), 
			(String)logEntry.getField(LogField.FILE), 
			(Integer)logEntry.getField(LogField.LINE), 
			(String)logEntry.getField(LogField.ROUTINE),
			(String)logEntry.getField(LogField.HOST), 
			(String)logEntry.getField(LogField.PROCESS), 
			(String)logEntry.getField(LogField.CONTEXT),
			(String)logEntry.getField(LogField.THREAD), 
			(String)logEntry.getField(LogField.LOGID), 
			(Integer)logEntry.getField(LogField.PRIORITY), 
			(String)logEntry.getField(LogField.URI), 
			(String)logEntry.getField(LogField.STACKID), 
			(Integer)logEntry.getField(LogField.STACKLEVEL), 
			(String)logEntry.getField(LogField.LOGMESSAGE),
			(String)logEntry.getField(LogField.SOURCEOBJECT), 
			(String)logEntry.getField(LogField.AUDIENCE), 
			(String)logEntry.getField(LogField.ARRAY), 
			(String)logEntry.getField(LogField.ANTENNA), 
			logEntry.getAdditionalData());
		
		this.setOrigin(origin);
		this.setUid((Long)logEntry.getField(LogField.TIMESTAMP), log_preuid);
	}
	
	public String getOrigin() {
		return origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	public String getUid() {
		return this.uid;
	}
	
	public void setUid(Long timestamp, String log_preuid) {
		this.uid = ACSLogEntryWrapper.generateUID(timestamp, log_preuid);
	}
	
	public static String generateUID(Long timestamp, String log_preuid) {
		return String.valueOf(timestamp) + "_" + log_preuid;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy