package com.cisdi.data.XRFLEFT.impl;

import com.cisdi.data.sdk.gateway.netty.IoSession;
import com.cisdi.data.sdk.gateway.netty.impl.AbstractSessionFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.UUID;

/**
 * @author cuianbing
 * @version 1.0
 * @description: TODO
 * @date 2021/7/7 18:52
 */
@Slf4j
public class XRFLeftSessionFactory extends AbstractSessionFactory {

    private String onlyOneDeviceId;

    /**
     * @description:
     * @param: onlyOneDeviceId  设备唯一ID
     * @return:  void
     * @author cuianbing
     * @date: 2021/7/7 22:10
     */
    public XRFLeftSessionFactory(String onlyOneDeviceId) {
        this.onlyOneDeviceId = onlyOneDeviceId;
    }

    @Override
    public IoSession newSession() {
        IoSession session = new XRFLeftIoSession(this, onlyOneDeviceId);
        session.init(UUID.randomUUID().toString(), provider, socketGateway);
        sessionSet.add(session);
        return session;
    }

}
