package com.qqchen.deploy.backend.framework.enums;

/**
 * SSH断开连接原因枚举（Framework层）
 * 
 * 用于标识SSH连接断开的具体原因，便于审计和追踪
 */
public enum SSHDisconnectReason {
    /**
     * 正常关闭（用户主动关闭）
     */
    NORMAL_CLOSE("NORMAL_CLOSE", "正常关闭"),
    
    /**
     * 服务器优雅下线
     */
    SERVER_SHUTDOWN("SERVER_SHUTDOWN", "服务器关闭"),
    
    /**
     * 客户端断开连接
     */
    CLIENT_DISCONNECT("CLIENT_DISCONNECT", "客户端断开"),
    
    /**
     * 网络错误
     */
    NETWORK_ERROR("NETWORK_ERROR", "网络错误"),
    
    /**
     * 会话超时
     */
    SESSION_TIMEOUT("SESSION_TIMEOUT", "会话超时"),
    
    /**
     * SSH连接失败
     */
    CONNECTION_FAILED("CONNECTION_FAILED", "连接失败"),
    
    /**
     * 认证失败
     */
    AUTH_FAILED("AUTH_FAILED", "认证失败"),
    
    /**
     * 并发连接数超限
     */
    CONCURRENT_LIMIT("CONCURRENT_LIMIT", "并发限制"),
    
    /**
     * 传输错误
     */
    TRANSPORT_ERROR("TRANSPORT_ERROR", "传输错误"),
    
    /**
     * 未知原因
     */
    UNKNOWN("UNKNOWN", "未知原因");
    
    private final String code;
    private final String description;
    
    SSHDisconnectReason(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
}
