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

import com.its.app.utils.NettyUtils;
import com.its.vms.entity.TbVmsCtlr;
import com.its.vms.xnettcp.vms.process.service.SubscriptionService;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SubscriptionRegisterService implements SubscriptionService {
    private static SubscriptionRegisterService _instance = null;

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

    public SubscriptionRegisterService() {
    }

    @Override
    public boolean response(TbVmsCtlr obj, Channel channel, int objectId) {
        /*
         *  SubscriptionResponse 에서 호출
         */
        String ipAddress = NettyUtils.getRemoteIpAddress(channel);
        //log.info("SubscriptionRegisterService.response: {}. ObjectId: {}", ipAddress, objectId);

        return true;
    }

}
