package com.cisdi.data.Spectrograph8860.impl;

import com.cisdi.data.sdk.gateway.netty.IoSession;
import com.cisdi.data.sdk.gateway.netty.impl.AbstractSessionFactory;

import java.util.UUID;

public class SGSessionFactory extends AbstractSessionFactory {

    private String onlyOneDeviceId;

    public SGSessionFactory(String onlyoneDeviceId) {
        this.onlyOneDeviceId = onlyoneDeviceId;
    }

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