package com.ho.filecenter.util;

import java.util.Arrays;
import java.util.List;

public class AnotherMqttConfigUtil {

    public static String[] commonTopic = new String[]{
            "+/device/27d83a2844ff5866",
            "+/device/77ba753718908d1a",
            "+/device/93372fa4f4c4ebcf",
            "1/device/+"
    };

    /**
     * 获取文件请求监听主题
     * @return
     */
    public static String[] getFileRequestTopic(){
        String log = "/file/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[] getFileResponseTopic(){
        String log = "/file/response";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }

    public static String[] getCurveResponseTopic(){
        String log = "/curve/response";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }

    public static String[] getDispatchResponseTopic(){
        String log = "/dispatch/response";
        String[] str = new String[commonTopic.length];
        for (int i = 0; i < commonTopic.length; i++) {
            str[i] = commonTopic[i]+log;
        }
        return  str;
    }

    /**
     * 获取SN配置合集
     * @return
     */
    public static List<String> getSnList(){
        List<String> strings = Arrays.asList(commonTopic);
        return  strings;
    }
}
