package com.eactive.eai.adapter.websocket;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class WebSocketSessionListener implements HttpSessionListener {

	@Override
	public void sessionCreated(HttpSessionEvent sessionEvent) {
//		HttpSession session = sessionEvent.getSession();
//		Object obj = session.getAttribute("tlogin");
//		if (obj != null){
//			HashMap tlogin        = (HashMap)session.getAttribute("tlogin");
//			
//    		SessionVO sessionObj = new SessionVO();
//    		EAIServerManager mgr = EAIServerManager.getInstance();
////            EAIServerVO localServer = mgr.getEAIServer( mgr.getLocalServerName());                        
//    		sessionObj.setLoginInstId(mgr.getLocalServerName());
//    		sessionObj.setLoginUserId( (String)tlogin.get("USER_ID") );
//    		sessionObj.setUuid((String)tlogin.get("UUID"));
//    		
//			SessionManager.getInstance().putLogin((String)tlogin.get("USER_ID"),sessionObj );
//		}
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent sessionEvent) {
//		HttpSession session = sessionEvent.getSession();
//		Object obj = session.getAttribute("tlogin");
//		if (obj != null){
//			HashMap tlogin        = (HashMap)session.getAttribute("tlogin");
//			SessionManager.getInstance().removeLogin((String)tlogin.get("USER_ID"));
//		}
	}
}
