@@ -0,0 +1,1499 @@
+package com.exalttech.trex.ui.views.services;%0A%0Aimport javafx.concurrent.ScheduledService;%0Aimport javafx.concurrent.Task;%0A%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.Arrays;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Aimport com.exalttech.trex.core.RPCCommands;%0Aimport com.exalttech.trex.remote.models.stats.ActivePGIdsRPCResult;%0A%0A%0Apublic class ActiveStreamsService extends ScheduledService%3CSet%3CInteger%3E%3E %7B%0A    private static org.slf4j.Logger LOG = LoggerFactory.getLogger(ActiveStreamsService.class);%0A%0A    private final Set%3CInteger%3E pgids = new HashSet%3C%3E();%0A%0A    @Override%0A    protected Task%3CSet%3CInteger%3E%3E createTask() %7B%0A        return new Task%3CSet%3CInteger%3E%3E() %7B%0A            @Override%0A            protected Set%3CInteger%3E call() %7B%0A                try %7B%0A                    final ActivePGIdsRPCResult activePGIdsRPCResult = RPCCommands.getActivePGIds();%0A                    final Integer%5B%5D flowStats = activePGIdsRPCResult.getIds().getFlowStats();%0A                    final Integer%5B%5D latency = activePGIdsRPCResult.getIds().getLatency();%0A                    synchronized (pgids) %7B%0A                        pgids.clear();%0A                        pgids.addAll(Arrays.asList(flowStats));%0A                        pgids.addAll(Arrays.asList(latency));%0A                    %7D%0A                %7D catch (Exception exc) %7B%0A                    LOG.error(%22Failed to get active PGIDs%22, exc);%0A                    return null;%0A                %7D%0A                return pgids;%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

Implement ActiveStreamsService.