package com.netty;

import java.util.Date;

/**
 * Syslog 消息实体类
 */
public class SyslogMessage {
    private Integer facility;
    private Integer severity;
    private Date timestamp;
    private String hostname;
    private String message;

    // 构造函数
    public SyslogMessage() {}

    // Getter 和 Setter 方法
    public Integer getFacility() {
        return facility;
    }

    public void setFacility(Integer facility) {
        this.facility = facility;
    }

    public Integer getSeverity() {
        return severity;
    }

    public void setSeverity(Integer severity) {
        this.severity = severity;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        // 这里可以添加时间戳解析逻辑
        // 简化实现，直接使用当前时间
        this.timestamp = new Date();
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "SyslogMessage{" +
                "facility=" + facility +
                ", severity=" + severity +
                ", timestamp=" + timestamp +
                ", hostname='" + hostname + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}