Package com.betfair.cougar.client.socket

Examples of com.betfair.cougar.client.socket.HeapState


                if (showDetailedSessionBreakdown) {
                    result.append("<th>Last delta received</th><th>Num subscribers</th>");
                }
                result.append("<th></th></tr>\n");
                for (Long id : heapIds) {
                    HeapState heapState = heaps.getHeapState(id);
                    if (heapState != null) {
                    result.append("<tr><td>").append(heapState.getHeapUri()).append("</td>");
                        // for each connected object, show last delta sent/received (id), show number of subscribers
                        if (showDetailedSessionBreakdown) {
                            // add last delta sent/num subscribers
                            result.append("<td>").append(heapState.getLastDeltaId()).append("</td><td>").append(heapState.getSubscriptionCount()).append("</td>");
                        }
                        // add link to connected object detail
                        if (id.equals(heapIdToBreakDown)) {
                            result.append("<td><a href='").append(getPath()).append("?sessionId=").append(URLEncoder.encode(sessionIdToBreakDown)).append("&detailedSession=").append(showDetailedSessionBreakdown).append("&detailedHeap=").append(showDetailedHeapBreakdown).append("&killLinks=").append(showKillLinks).append("'>Hide breakdown</a></td>");
                        }
                        else {
                            result.append("<td><a href='").append(getPath()).append("?sessionId=").append(URLEncoder.encode(sessionIdToBreakDown)).append("&detailedSession=").append(showDetailedSessionBreakdown).append("&detailedHeap=").append(showDetailedHeapBreakdown).append("&killLinks=").append(showKillLinks).append("&heapId=").append(id).append("'>Show breakdown</a></td>");
                        }
                        result.append("</tr>\n");
                    }
                }
                result.append("</table>");
            }
        }

        // --------------------------- Subscriber list view --------------------------------------

        // show list of subscribers if requested
        if (session != null && heapIdToBreakDown != null) {
            ClientConnectedObjectManager.ConnectedHeaps heaps = connectedObjectManager.getHeapsForSession(session);
            HeapState heapState = heaps != null ? heaps.getHeapState(heapIdToBreakDown) : null;
            if (heapState != null) {
                result.append("<hr width='100%'/>\n<h3>Subscriber breakdown for heap '").append(heapState.getHeapUri()).append("' on connection '").append(sessionIdToBreakDown).append("'</h3>\n");

                result.append("<table border='1' width='100%' align='center'><tr><th>Subscription Id</th><th></th></tr>\n");
                List<ClientSubscription> subs = new ArrayList<ClientSubscription>(heapState.getSubscriptions().values());
                if (subs != null) {
                    for (ClientSubscription sub : subs) {
                        result.append("<tr><td>").append(sub.getSubscriptionId()).append("</td>");
                        if (showKillLinks) {
                            result.append("<td><a href='").append(getPath()).append(queryString).append("&subscriptionIdToKill=").append(sub.getSubscriptionId()).append("'>Kill</a></td>");
View Full Code Here

TOP

Related Classes of com.betfair.cougar.client.socket.HeapState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.