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 SubscriptionSingleService implements SubscriptionService {
    private static SubscriptionSingleService _instance = null;

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

    public SubscriptionSingleService() {
    }

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

        return true;
    }

}
