package com.bocloud.ims.common.utils.constant;

import com.bocloud.common.enums.BoCloudService;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * 常量
 *
 * @author sxp
 * @since Dec 27, 2017
 */
public class Constant {
    public static final String MISSING_VALUE = "${MISSING-VALUE}";
    public static final String WHITE_SPACE = " ";

    public static final String TARGETS = "targets";
    public static final String QUEUE = "queue";
    public static final String MAX_DATA = "3000/12/31";
    public static final String AUTHORITY = "authority";
    public static final String USERS = "users";
    public static final String SUDO = "sudo";
    public static final String ARGS = "args";
    public static final String MODULE = "module";
    public static final String WORKER_MSG = "bocloud_worker_msg";
    public static final String WORKER_DECRYPT = "bocloud_decrypt";
    public static final String RESULTS = "results";
    public static final String STDOUT = "stdout";
    public static final String STDOUT_LINES = "stdout_lines";
    public static final String STATE = "state";
    public static final String ENABLED = "enabled";
    public static final String SERVICE = "service";
    public static final String CONTENT = "content";
    public static final String TIMEOUT = "timeout";
    public static final String MASTER = "master";
    public static final String SLAVE = "slave";
    public static final String SENTINEL = "sentinel";
    public static final String REPLICA = "replica";
    public static final String ARBITER = "arbiter";
    public static final String VERSION = "version";
    public static final String RESPONSE = "response";
    public static final String ASYNC_PLAYBOOK = "async_playbook";

    public static final String TASK_NAME = "taskName";
    public static final String HOST_TYPE = "hostType";
    public static final String INSTALL_DIR = "installDir";
    public static final String INSTALL_PREFIX = "install_";

    public static final String INSTALL_TASK_ID = "install_task_id";
    public static final String INSTALL_TASK_LOG_ID = "install_task_log_id";
    public static final String OPTIONS = "options";
    public static final String YES = "YES";
    public static final String NO = "NO";

    public static final String INSTALL_CONFIG = "install_config";
    public static final String SOFTWARE_CONFIG = "software_config";
    public static final String HOSTS_TYPE = "hosts_type";
    public static final String MYSQL_USERS = "mysql_users";
    public static final String MYSQL_DATABASES = "mysql_databases";
    public static final String MYSQL_PACKAGES = "mysql_packages";
    public static final String MYSQL_REPLICATION_USER = "mysql_replication_user";
    public static final String RABBITMQ_USERS = "rabbitmq_users";
    public static final String RABBITMQ_VHOSTS = "rabbitmq_vhosts";
    public static final String RABBITMQ_PLUGINS = "rabbitmq_plugins";
    public static final String INSTALL_JCE = "install_jce";
    public static final String SET_JAVA_HOME = "set_java_home";
    public static final String TOMCAT_INSTANCES = "tomcat_instances";
    public static final String NGINX_SITES = "nginx_sites";
    public static final String NGINX_HTTP_PARAMS = "nginx_http_params";
    public static final String NGINX_CONFIGS = "nginx_configs";
    public static final String START_MODE = "start_mode";
    public static final String CRYPTED_TYPE = "crypted_type";
    public static final String PASSWORD_EXPIRED = "password_expired";
    public static final String NFS_SERVER = "nfs_server";
    public static final String NFS_CLIENT = "nfs_client";
    public static final String APACHE_VHOSTS = "apache_vhosts";

    public static final String ROOT = "root";
    public static final String PSWD = "password";
    public static final String DESCRIPTION = "description";
    public static final String GROUP = "group";
    public static final String SHELL = "shell";
    public static final String EXPIRES = "expires";

    /**
     * 当前平台(用当前服务的名称来赋值)
     */
    public static final String CURRENT_PLATFORM = BoCloudService.COP.name();

    public static final String PLATFORM = "platform";

    /**
     * 当前Java虚拟机可用的处理器数量
     */
    public static final int JVM_CPU_NUM = Runtime.getRuntime().availableProcessors();

    public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;

    public static final int TEN = 10;

    public static final String IPMI_PASSWORD = "ipmiPassword";

    public static final String PORT = "port";

    public static final String IPMI_PORT = "ipmiPort";

    public static final String HTTP_CODE_404 = "404";

    public static final String HTTP_CODE_409 = "409";

    public static final String NODE_ID = "nodeId";

    public static final String NETWORK = "network";

    public static final String INTERFACES = "interfaces";

    public static final String CPU = "cpu";

    public static final String NODE_TYPE = "nodeType";

    public static final String HOOK_ID = "hookId";

    public static final String HOOK_NAME = "nodeDiscover";

    public static final String HOOK_URI = "/hook/handler";

    public static final String NODE_HOOL_URI = "/hook/%s/handler";

    public static final String NODE = "node";

    public static final String STATUS = "status";

    public static final String ERROR = "error";

    public static final String ACTION = "action";

    public static final String CREATE_AT = "createdAt";

    public static final String TYPE = "type";

    public static final String TYPE_ID = "typeId";

    public static final String TASKS = "tasks";

    public static final String CONFIG = "config";

    public static final String OK = "ok";

    public static final String NO_READING = "No Reading";

    public static final String OBM_SERVICE = "ipmi-obm-service";

    public static final String SUCCEEDED = "succeeded";

    public static final String FAILED = "failed";

    public static final String ID = "id";

    public static final String INSTANCE_ID = "instanceId";

    public static final String NAME = "name";

    public static final String COMMAND = "command";

    public static final String IPMI_CMD_SDR = "sdr";

    public static final String CHASSIS = "chassis";

    public static final String DATA = "data";

    public static final String IP_ADDRESS = "IP Address";

    public static final String IPADDRESS = "ipAddress";

    public static final String IPMAC_ADDRESSES = "ipMacAddresses";

    public static final String MAC_ADDRESS = "macAddress";

    public static final String MAC = "mac";

    public static final String FS_ADDR = "fileServerAddress";

    public static final String FS_PORT = "fileServerPort";

    public static final String FS_PATH = "fileServerPath";

    public static final String INSTALL_ESXI = "Graph.InstallESXi";

    public static final String INSTALL_CENTOS = "Graph.InstallCentOS";

    public static final String INSTALL_WINDOWS = "Graph.InstallWindowsServer";

    public static final String INSTALL_UBUNTU = "Graph.InstallUbuntu";

    public static final String INSTALL_RHEL = "Graph.InstallRHEL";

    public static final String INSTALL_SUSE = "Graph.InstallSUSE";

    public static final String DEFAULT_NODE_TYPE = "compute";

    public static final String ENCLOSURE = "enclosure";

    public static final String DEFAULTS = "defaults";

    public static final String DEFAULTS_UBUNTU = "install-ubuntu";

    public static final String AUTO_DISCOVER = "autoDiscover";

    public static final String OBMS = "obms";

    public static final String GRAPH = "graph";

    public static final String GRAPH_NAME = "graphName";

    public static final String REF = "ref";

    public static final String HOST = "host";

    public static final String LOCALHOST = "localhost";

    public static final String FAN = "Fan";

    public static final String VOLTAGE = "Voltage";

    public static final String POWER = "Power Supply";

    public static final String TEMPERATURE = "Temperature";

    public static final String IPMI_IP = "ipmiIp";

    public static final String IPMI_USER = "ipmiUser";

    public static final String IPMI_PSWD = "ipmiPassword";

    public static final String IPMI_OBM_SERVICE = "ipmi-obm-service";

    public static final String USER = "user";

    public static final String CATALOGS = "catalogs";

    public static final String SOURCE = "source";

    public static final String COMMON = "common";

    public static final String IPMI_USER_NAME_KEY1 = "__rackhd__";

    public static final String IPMI_USER_NAME_KEY2 = "root";

    public static final String IPMI_USER_NAME_KEY3 = "Name";

    public static final String IPMI_USER_VALUE_EMPTY = "(Empty User)";

    public static final String CANCEL = "cancel";

    public static final String CANCELLED = "cancelled";

    public static final String RUNNING = "running";

    public static final String COOKIE = "cookie";

    public static final String URL = "url";

    public static final String WINPE = "winpe";

    public static final String DEFAULT_VSWITCH = "vSwitch0";

    public static final String TIME_OUT = "timed out";

    public static final String REFUSED = "Connection refused";

    public static final String NO_CONTENT = "No Content";

    public static final String DISK = "disk";

    public static final String IDENTIFIERS = "identifiers";

    public static final int DEFAULT_SSH_PORT = 22;

    public static final String LINUX_UNIX_ROOT_USER = "root";

    public static final String HTTP_PREFIX = "http://";


    public static final String KEY = "password";

    public static final String PASD = "pasd";

    public static final String IPMI_BOOT = "ipmi_boot";
    public static final String IPMI_POWER = "ipmi_power";
    public static final String RAW = "raw";
    public static final String SETUP = "setup";
    public static final String BOOTDEV = "bootdev";
    public static final String CATEGORY = "category";
    public static final String CONNECTION = "connection";

    /**
     * 站内信的消息队列名称
     */
    public static final String MESSAGE_QUEUE_ROUTINGKEY = "event.notice.queue";

    public static class WorkerOperationType {
        public static final String ADD = "add";
        public static final String MODIFY = "modify";
        public static final String DELETE = "delete";
        public static final String VIEW = "view";
    }

    public static class Software {
        public static final String ZOOKEEPER = "zookeeper";
        public static final String TOMCAT = "tomcat";
        public static final String REDIS = "redis";
        public static final String MYSQL = "mysql";
        public static final String NGINX = "nginx";
        public static final String WEBLOGIC = "weblogic";
        public static final String RABBITMQ = "rabbitmq";
        public static final String JDK = "jdk";
        public static final String JAVA = "java";
        public static final String NFS = "nfs";
        public static final String ORACLE = "oracle";
        public static final String APACHE = "apache";
        public static final String ACTIVEMQ = "activemq";
        public static final String KAFKA = "kafka";
        public static final String MONGODB = "mongodb";
        public static final String ETCD = "etcd";
        public static final String WAS = "was";
    }

    public static class WorkerResponseType {
        public static final String SYNC = "sync";
    }

}
