package cn.sagacloud.server.scheduler.pojo
/*
 * Author: Jxing
 * Create Time: 2019/3/11
 */

import java.util.ArrayList
import java.util.Arrays

enum class Command {
    SendTask,
    RefuseTask,
    AcceptTask,
    DownloadError,
    CommandError,
    TaskSuccess,
    HeartBeat,
    ClientInfo;


    companion object {
        private var cmdList: ArrayList<Command>? = null

        init {
            cmdList = ArrayList()
            cmdList!!.addAll(Arrays.asList(*Command.values()))
        }

        // 是否是和任务状态转换相关的命令
        fun isStatusRelated(cmd: Command): Boolean {
            return ClientInfo != cmd
        }
    }
}
