All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.dts.sdk.context.SDKContext Maven / Gradle / Ivy

package com.alibaba.dts.sdk.context;

import com.alibaba.dts.common.exception.DtsException;


public class SDKContext {

    // DTS online domain
    public static String DTS_DOMAIN_ONLINE_URL  = "http://ops.jm.taobao.org:9999/dts-console";
    // DTS daily
    public static String DTS_DOMAIN_DAILY_URL   = "http://ops.jm.taobao.net/dts-console";
    // aliyun
    public static String DTS_DOMAIN_ALIYUN_URL  = "";
    // usa
    public static String DTS_DOMAIN_USA_URL = "http://198.11.140.86/dts-console";

    private static ThreadLocal dtsCookie = new ThreadLocal();
    private static ThreadLocal userIdKey = new ThreadLocal();

    public static String acquireCookie() {
        String cookie = dtsCookie.get();
        if(null == cookie) {
            throw new DtsException("cookie is null, acquire should not happen before set.");
        }
        return cookie;
    }

    public static void setCookie(String cookie) {
        dtsCookie.set(cookie);
    }


    public static void clean() {
        dtsCookie.remove();
    }

    public static void setUserIdKey(String userId) {
        userIdKey.set(userId);
    }

    public static String getUserIdKey() {
        return userIdKey.get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy