package com.tsi.comm.server.repository;

import com.tsi.comm.server.vo.TsiNodeAddVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.ConcurrentHashMap;

@Slf4j
@RequiredArgsConstructor
@Component
public class TsiNodeAddManager {

    private final ConcurrentHashMap<Long, TsiNodeAddVo> tsiNodeAddMap = new ConcurrentHashMap<>();

    public TsiNodeAddVo get(long nodeId) {
        return this.tsiNodeAddMap.get(nodeId);
    }
    public void put(long nodeId, TsiNodeAddVo vo) {
        this.tsiNodeAddMap.put(nodeId, vo);
    }

    public int size() {
        return this.tsiNodeAddMap.size();
    }

    public boolean containsKey(long key) {
        return this.tsiNodeAddMap.containsKey(key);
    }

}
