package net.openmob.mobileimsdk.android.conf;


import net.openmob.mobileimsdk.android.core.KeepAliveDaemon;

public class IMConfigEntity {
    public static String appKey = null;

    public static String serverIP = "8.134.82.56";//IM_IP;

    public static int serverPort = 9903;//IM_PORT;

    public static int localPort = 0;

    public static void setSenseMode(IMConfigEntity.SenseMode mode) {
        int keepAliveInterval = 0;
        int networkConnectionTimeout = 0;
        switch(mode) {
            case MODE_3S:
                keepAliveInterval = 3000;
                networkConnectionTimeout = 10000;
                break;
            case MODE_10S:
                keepAliveInterval = 10000;
                networkConnectionTimeout = 21000;
                break;
            case MODE_30S:
                keepAliveInterval = 30000;
                networkConnectionTimeout = 61000;
                break;
            case MODE_60S:
                keepAliveInterval = 60000;
                networkConnectionTimeout = 121000;
                break;
            case MODE_120S:
                keepAliveInterval = 120000;
                networkConnectionTimeout = 241000;
        }

        if (keepAliveInterval > 0) {
            KeepAliveDaemon.KEEP_ALIVE_INTERVAL = keepAliveInterval;
        }

        if (networkConnectionTimeout > 0) {
            KeepAliveDaemon.NETWORK_CONNECTION_TIME_OUT = networkConnectionTimeout;
        }

    }

    public static enum SenseMode {
        MODE_3S,
        MODE_10S,
        MODE_30S,
        MODE_60S,
        MODE_120S;

        private SenseMode() {
        }
    }
}

