package com.easyagents.agent.runtime.persistence;

/**
 * 控制运行时状态持久化。
 */
public class AgentPersistencePolicy {

    private boolean enabled;
    private boolean memoryManaged;
    private boolean toolkitManaged;
    private boolean planNotebookManaged;
    private boolean statefulToolsManaged;
    private boolean hitlManaged;
    private boolean sessionManaged;
    private boolean conversationRecordingEnabled;

    /**
     * 创建禁用策略。
     *
     * @return 禁用策略
     */
    public static AgentPersistencePolicy disabled() {
        return new AgentPersistencePolicy();
    }

    /**
     * 创建仅记忆持久化策略。
     *
     * @return 仅记忆持久化策略
     */
    public static AgentPersistencePolicy memoryOnly() {
        AgentPersistencePolicy policy = new AgentPersistencePolicy();
        policy.setEnabled(true);
        policy.setMemoryManaged(true);
        policy.setSessionManaged(true);
        return policy;
    }

    /**
     * 返回是否persistence is enabled。
     *
     * @return 启用标记
     */
    public boolean isEnabled() {
        return enabled;
    }

    /**
     * 设置启用标记。
     *
     * @param enabled 启用标记
     */
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    /**
     * 返回是否memory is managed。
     *
     * @return 记忆标记
     */
    public boolean isMemoryManaged() {
        return memoryManaged;
    }

    /**
     * 设置记忆标记。
     *
     * @param memoryManaged 记忆标记
     */
    public void setMemoryManaged(boolean memoryManaged) {
        this.memoryManaged = memoryManaged;
    }

    /**
     * 返回是否toolkit is managed。
     *
     * @return Toolkit 标记
     */
    public boolean isToolkitManaged() {
        return toolkitManaged;
    }

    /**
     * 设置Toolkit 标记。
     *
     * @param toolkitManaged Toolkit 标记
     */
    public void setToolkitManaged(boolean toolkitManaged) {
        this.toolkitManaged = toolkitManaged;
    }

    /**
     * 返回是否plan notebook is managed。
     *
     * @return 计划笔记标记
     */
    public boolean isPlanNotebookManaged() {
        return planNotebookManaged;
    }

    /**
     * 设置计划笔记标记。
     *
     * @param planNotebookManaged 计划笔记标记
     */
    public void setPlanNotebookManaged(boolean planNotebookManaged) {
        this.planNotebookManaged = planNotebookManaged;
    }

    /**
     * 返回是否stateful tools are managed。
     *
     * @return 有状态工具标记
     */
    public boolean isStatefulToolsManaged() {
        return statefulToolsManaged;
    }

    /**
     * 设置有状态工具标记。
     *
     * @param statefulToolsManaged 有状态工具标记
     */
    public void setStatefulToolsManaged(boolean statefulToolsManaged) {
        this.statefulToolsManaged = statefulToolsManaged;
    }

    /**
     * 返回是否HITL pending state is managed。
     *
     * @return HITL 标记
     */
    public boolean isHitlManaged() {
        return hitlManaged;
    }

    /**
     * 设置HITL 标记。
     *
     * @param hitlManaged HITL 标记
     */
    public void setHitlManaged(boolean hitlManaged) {
        this.hitlManaged = hitlManaged;
    }

    /**
     * 返回是否session storage is managed。
     *
     * @return 会话标记
     */
    public boolean isSessionManaged() {
        return sessionManaged;
    }

    /**
     * 设置会话标记。
     *
     * @param sessionManaged 会话标记
     */
    public void setSessionManaged(boolean sessionManaged) {
        this.sessionManaged = sessionManaged;
    }

    /**
     * 返回是否conversation events should be recorded。
     *
     * @return 会话记录标记
     */
    public boolean isConversationRecordingEnabled() {
        return conversationRecordingEnabled;
    }

    /**
     * 设置会话记录标记。
     *
     * @param conversationRecordingEnabled 会话记录标记
     */
    public void setConversationRecordingEnabled(boolean conversationRecordingEnabled) {
        this.conversationRecordingEnabled = conversationRecordingEnabled;
    }
}
