package com.ho.datacollect.util;

public class MqttConfigUtil {

    public static String[] commonTopic = new String[]{
            "+/device/93372fa4f4c4ebcf",
            "+/device/5b69426e2ff8e459",
            "1/device/+"
    };

    /**
     * 获取登录验证的监听主题
     * @return
     */
    public static String[] getLoginRequestTopic(){
        String log = "/login/request";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }

    /**
     * 读取文件请求的监听主题
     * @return
     */
    public static String[] getReadRequestTopic(){
        String log = "/read/response";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }

    /**
     * 写文件响应的监听主题
     * @return
     */
    public static String[] getWriteRequestTopic(){
        String log = "/write/response";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }

    /**
     * 获取数据上送监听主题
     * @return
     */
    public static String[] getReportPushTopic(){
        String log = "/report/push";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }

    /**
     * 获取远程控制主题
     * @return
     */
    public static String[] getControlResponseTopic(){
        String log = "/control/response";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }
}
