Package org.jivesoftware.openfire.plugin

Examples of org.jivesoftware.openfire.plugin.MonitoringPlugin


     *
     * @return a Map of ConversationInfo objects.
     */
    public Map<String, ConversationInfo> getConversations(boolean formatParticipants) {
        Map<String, ConversationInfo> cons = new HashMap<String, ConversationInfo>();
        MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager()
            .getPlugin("monitoring");
        ConversationManager conversationManager =
            (ConversationManager)plugin.getModule(ConversationManager.class);
        Collection<Conversation> conversations = conversationManager.getConversations();
        List<Conversation> lConversations =
            Arrays.asList(conversations.toArray(new Conversation[conversations.size()]));
        for (Iterator<Conversation> i = lConversations.iterator(); i.hasNext();) {
            Conversation con = i.next();
View Full Code Here


        long[] startAndEnd = GraphEngine.parseTimePeriod(timePeriod);
        return getUpdatedStat(statkey, startAndEnd);
    }

    private Map getUpdatedStat(String statkey, long[] timePeriod) {
        MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin("monitoring");
        StatsViewer viewer = (StatsViewer)plugin.getModule(StatsViewer.class);
        String[] lowHigh = getLowAndHigh(statkey, timePeriod);
        Map stat = new HashMap();
        stat.put("low", lowHigh[0]);
        stat.put("high", lowHigh[1]);
        stat.put("count", (int)viewer.getCurrentValue(statkey)[0]);
View Full Code Here

     * @return a List of Map objects.
     */
    public List<Map<String, Long>> getNLatestConversations(int count, long mostRecentConversationID) {
        // TODO Fix plugin name 2 lines below and missing classes
        List<Map<String, Long>> cons = new ArrayList<Map<String, Long>>();
        MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin("monitoring");
        ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
        Collection<Conversation> conversations = conversationManager.getConversations();
        List<Conversation> lConversations = Arrays.asList(conversations.toArray(new Conversation[conversations.size()]));
        Collections.sort(lConversations, conversationComparator);
        int counter = 0;
        for (Iterator<Conversation> i = lConversations.iterator(); i.hasNext() && counter < count;) {
View Full Code Here

     * @param key the name of the statistic to return high and low values for.
     * @param timePeriod start date, end date and number of data points.
     * @return low and high values for the given time period / number of datapoints
     */
    public static String[] getLowAndHigh(String key,  long[] timePeriod) {
        MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin("monitoring");
        StatsViewer viewer = (StatsViewer)plugin.getModule(StatsViewer.class);
        Statistic.Type type = viewer.getStatistic(key)[0].getStatType();
        double[] lows = viewer.getMin(key, timePeriod[0], timePeriod[1], (int)timePeriod[2]);
        double[] highs = viewer.getMax(key, timePeriod[0], timePeriod[1], (int)timePeriod[2]);
        String low;
        NumberFormat format = NumberFormat.getNumberInstance();
View Full Code Here

TOP

Related Classes of org.jivesoftware.openfire.plugin.MonitoringPlugin

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.