package com.its.vms.xnettcp.vms.process.service;

import com.its.app.AppUtils;
import com.its.vms.dao.mapper.RseOffrSectMapper;
import com.its.vms.entity.TbRseOffrSect;
import com.its.vms.entity.TbRseOffrSectTraf;
import com.its.vms.dto.voDsrcOffrSectTraf;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

@Slf4j
public class MultiMediaDataService {

    private RseOffrSectMapper rseOffrSectMapper;
    private ConcurrentHashMap<String, TbRseOffrSect> offrSectInfoMap = null;
    private ConcurrentHashMap<String, voDsrcOffrSectTraf> offrSectTrafMap = null;
    private List<TbRseOffrSectTraf> offrInfrHsList = null;

    private static MultiMediaDataService _instance = null;

    public static MultiMediaDataService getInstance() {
        if (_instance == null) {
            synchronized (MultiMediaDataService.class) {
                if (_instance == null)
                    _instance = new MultiMediaDataService();
            }
        }
        return _instance;
    }

    public MultiMediaDataService() {
        this.rseOffrSectMapper = (RseOffrSectMapper) AppUtils.getBean(RseOffrSectMapper.class);
        this.offrSectInfoMap = new ConcurrentHashMap<String, TbRseOffrSect>();
        this.offrSectTrafMap = new ConcurrentHashMap<String, voDsrcOffrSectTraf>();
        this.offrInfrHsList = Collections.synchronizedList(new ArrayList<>());
    }

}
