public TabularData getOffsetPerSubscriber()

in src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistPublisherJMX.java [60:79]


    public TabularData getOffsetPerSubscriber() throws MBeanException {
        try {
            String[] itemNames = new String[] {COL_ID, COL_OFFSET};
            OpenType<?>[] itemTypes = new OpenType[]{SimpleType.STRING, SimpleType.LONG};
            CompositeType rowType = new CompositeType("Offsets", "Offsets by sub agent", itemNames, itemNames, itemTypes);
            TabularType type = new TabularType("type", "desc", rowType, new String[] {COL_ID});
            TabularDataSupport table = new TabularDataSupport(type);
            Set<State> subscribedAgents = discoveryService.getTopologyView().getSubscribedAgents(pubAgentName);
            for (State state : subscribedAgents) {
                CompositeData row = new CompositeDataSupport(rowType, itemNames, new Object[] { 
                        state.getSubAgentId(), 
                        state.getOffset()
                        });
                table.put(row);
            }
            return table;
        } catch (OpenDataException e) {
            throw new MBeanException(e);
        }
    }