package com.jpsoft.shinestar.modules.uniview.utils;

import com.jpsoft.shinestar.modules.uniview.channel.LapiChannel;

import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class LapiSessionUtil {
    private static final Map<String, LapiChannel> activeChannelMap = new ConcurrentHashMap<>();

    public static void put(String deviceNo, LapiChannel channel) {
        activeChannelMap.put(deviceNo, channel);
    }

    public static LapiChannel get(String deviceNo) {
        return activeChannelMap.get(deviceNo);
    }

    public static boolean containsKey(String deviceNo) {
        return activeChannelMap.containsKey(deviceNo);
    }

    public static void remove(String deviceNo) {
        activeChannelMap.remove(deviceNo);
    }

    public static Set<String> keySet(){
        return activeChannelMap.keySet();
    }
}
