<%@ page import="java.io.*"%> <%@ page language="java" contentType="text/html; charset=utf-8"%> <%@ page import="com.eactive.eai.adapter.websocket.WebSocketSessionManager,org.java_websocket.WebSocket"%> <%@ page import="java.util.concurrent.ConcurrentHashMap"%> <%@ page import="com.eactive.eai.common.session.SessionManager,com.eactive.eai.common.session.SessionVO"%> <%@ page import="com.eactive.eai.common.session.CacheInfoVO"%> <%@ page import="java.util.*"%> <%@ page import="org.apache.mina.common.IoSession"%> <%@ page import="java.util.concurrent.ConcurrentHashMap"%> <%@ page import="net.sf.ehcache.Cache"%> <%@ page import="net.sf.ehcache.Cache,net.sf.ehcache.Element"%> <%@ page import="com.eactive.eai.adapter.socket2.common.ExpiringMap"%> <%@ page import="com.eactive.eai.common.util.DatetimeUtil"%> <%@ page import="com.eactive.eai.common.server.EAIServerManager"%> WebSocket Login Monitoring

[ WebSocket Login Monitoring ]

<% String eaiSvrInstNm = EAIServerManager.getInstance().getLocalServerName(); String loginUserId = request.getParameter("loginUserId"); boolean isSpUserFound = false; String spUuid = null; try { if(loginUserId == null) { loginUserId = ""; } else { loginUserId = loginUserId.trim(); if(loginUserId.length() > 0) isSpUserFound = true; } SessionManager sessionManager = SessionManager.getInstance(); CacheInfoVO mcache = sessionManager.getEvictMasterCache(); %>
  • WAS Instance name : <%=eaiSvrInstNm %>
  • Current DateTime : <%=DatetimeUtil.getTimeStampString() %>
  • Search parameter : loginUserId

    Adapter WebSocket (Local)

    <% WebSocketSessionManager wsSessionManager = WebSocketSessionManager.getInstance(); HashMap> adapterGroups = wsSessionManager.getAdapterGroupConnections(); Iterator i = adapterGroups.keySet().iterator(); while (i.hasNext()) { String key = (String) i.next(); ConcurrentHashMap conMap = adapterGroups.get(key); %> <% if(isSpUserFound) { WebSocket s = (WebSocket)conMap.get(loginUserId); if(s!= null) { %> <% } } else { Iterator ci = conMap.keySet().iterator(); while (ci.hasNext()) { String ckey = (String) ci.next(); WebSocket s = (WebSocket)conMap.get(ckey); %> <% } } } CacheInfoVO cacheInfo = sessionManager.getLoginCache(); String cacheName = cacheInfo.getName(); String cacheSize = String.valueOf(cacheInfo.getSize()); String cacheTime = String.valueOf(cacheInfo.getTimeToLiveSeconds()); %>
    adapterGroupName loginUserId localSocketAddress RemoteSocketAddress socketStatus
    <%= key %> <%= loginUserId %> <%= s.getLocalSocketAddress() %> <%= s.getRemoteSocketAddress() %> <%= s.getReadyState().name() %>
    <%= key %> <%= ckey %> <%= s.getLocalSocketAddress() %> <%= s.getRemoteSocketAddress() %> <%= s.getReadyState().name() %>

    Shared Cache Info (Distributed)

    CacheName: <%= cacheName %>, CacheSize: <%= cacheSize %>, Cache TTL: <%= cacheTime %>

    Shared Cache - Login Session Info

    <% if(isSpUserFound) { SessionVO svo = null; for(String uuid : sessionManager.getHttpLoginCache().getKeys()) { SessionVO httpLogin = sessionManager.getHttpLogin(uuid); if( loginUserId.equals(httpLogin.getLoginUserId()) ) { svo = httpLogin; spUuid = httpLogin.getUuid(); break; } } if(svo != null) { spUuid = svo.getUuid(); %> <% } } else { for(String key : cacheInfo.getKeys()) { SessionVO svo = sessionManager.getHttpLogin(key); %> <% } } %>
    key loginUserId loginInstId wsInstId wsAdapterGroupName uuid brncd terminalId
    <%= loginUserId %> <%= svo.getLoginUserId() %> <%= svo.getLoginInstId() %> <%= svo.getWsInstId() %> <%= svo.getWsAdapterGroupName() %> <%= svo.getUuid() %> <%= svo.getBrncd() %> <%= svo.getTerminalId() %>
    <%= key %> <%= svo.getLoginUserId() %> <%= svo.getLoginInstId() %> <%= svo.getWsInstId() %> <%= svo.getWsAdapterGroupName() %> <%= svo.getUuid() %> <%= svo.getBrncd() %> <%= svo.getTerminalId() %>

    <% CacheInfoVO hcache = sessionManager.getHttpLoginCache(); cacheName = hcache.getName(); cacheSize = String.valueOf(hcache.getSize()); cacheTime = String.valueOf(hcache.getTimeToLiveSeconds()); %>

    HTTP Login Cache Info (Distributed)

    CacheName: <%= cacheName %>, CacheSize: <%= cacheSize %>, Cache TTL: <%= cacheTime %>

    HTTP Login Cache - Session Info

    <% int rowCount = 0; if(isSpUserFound) { SessionVO svo = sessionManager.getHttpLogin(spUuid); if(svo != null) { %> <% } } else { for(String key : hcache.getKeys()) { SessionVO svo = sessionManager.getHttpLogin(key); if (svo == null){ continue; } %> <% } } %>
    key loginUserId loginInstId wsInstId wsAdapterGroupName uuid brncd terminalId
    <%= spUuid %> <%= svo.getLoginUserId() %> <%= svo.getLoginInstId() %> <%= svo.getWsInstId() %> <%= svo.getWsAdapterGroupName() %> <%= svo.getUuid() %> <%= svo.getBrncd() %> <%= svo.getTerminalId() %>
    <%= key %> <%= svo.getLoginUserId() %> <%= svo.getLoginInstId() %> <%= svo.getWsInstId() %> <%= svo.getWsAdapterGroupName() %> <%= svo.getUuid() %> <%= svo.getBrncd() %> <%= svo.getTerminalId() %>

    <% } catch(Exception e) { e.printStackTrace(); //e.printStackTrace(out); } %>