Package org.jivesoftware.openfire.plugin

Examples of org.jivesoftware.openfire.plugin.MonitoringPlugin


    private StatsViewer statsViewer;

    @Override
  public void init() throws ServletException {
        // load dependencies
        MonitoringPlugin plugin =
                (MonitoringPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("monitoring");
        this.graphEngine = (GraphEngine) plugin.getModule(GraphEngine.class);
        this.statsViewer = (StatsViewer)plugin.getModule(StatsViewer.class);
    }
View Full Code Here


        long conversationID = ParamUtils.getLongParameter(request, "conversationID", -1);
        if (conversationID == -1) {
            return;
        }

        MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin(
            "monitoring");
        ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
        Conversation conversation;
        if (conversationID > -1) {
            try {
                conversation = new Conversation(conversationManager, conversationID);
View Full Code Here

    public Object getResult() {
        return conversations;
    }

    public void run() {
        MonitoringPlugin plugin = (MonitoringPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(
            "monitoring");
        ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
        conversations = conversationManager.getConversations();
    }
View Full Code Here

    public Object getResult() {
        return conversation;
    }

    public void run() {
        MonitoringPlugin plugin = (MonitoringPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(
            "monitoring");
        ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
        try {
            conversation = conversationManager.getConversation(conversationID);
        } catch (NotFoundException e) {
            // Ignore. The requester of this task will throw this exception in his JVM
        }
View Full Code Here

    public Object getResult() {
        return null;
    }

    public void run() {
        MonitoringPlugin plugin = (MonitoringPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(
            "monitoring");
        ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
        for (ConversationEvent event : events) {
            try {
                event.run(conversationManager);
            } catch (Exception e) {
                Log.error("Error while processing chat archiving event", e);
View Full Code Here

    public Object getResult() {
        return conversationCount;
    }

    public void run() {
        MonitoringPlugin plugin = (MonitoringPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(
            "monitoring");
        ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
        conversationCount = conversationManager.getConversationCount();
    }
View Full Code Here

            ExternalizableUtil.getInstance().writeSerializable(out, room);
        }
    }

    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        MonitoringPlugin plugin = (MonitoringPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(
                "monitoring");
        conversationManager = (ConversationManager) plugin.getModule(ConversationManager.class);


        this.participants = new ConcurrentHashMap<String, UserParticipations>();

        conversationID = ExternalizableUtil.getInstance().readLong(in);
View Full Code Here

    @Override
  public void execute(SessionData data, Element command) {
        Element note = command.addElement("note");
        // Get handle on the Monitoring plugin
        MonitoringPlugin plugin = (MonitoringPlugin) XMPPServer.getInstance().getPluginManager()
                .getPlugin("monitoring");
        ConversationManager conversationManager =
                (ConversationManager) plugin.getModule(ConversationManager.class);
        if (!conversationManager.isArchivingEnabled()) {
            note.addAttribute("type", "error");
            note.setText("Message archiving is not enabled.");

            DataForm form = new DataForm(DataForm.Type.result);

            FormField field = form.addField();
            field.setType(FormField.Type.hidden);
            field.setVariable("FORM_TYPE");
            field.addValue("http://jabber.org/protocol/admin");

            field = form.addField();
            field.setLabel("Conversation Found?");
            field.setVariable("found");
            field.addValue(false);
            // Add form to reply
            command.add(form.getElement());

            return;
        }

        try {
            JID participant = new JID(data.getData().get("participant").get(0));
            JID room = new JID(data.getData().get("room").get(0));
            Date time = DataForm.parseDate(data.getData().get("time").get(0));
            boolean includePDF = DataForm.parseBoolean(data.getData().get("includePDF").get(0));

            // Get archive searcher module
            ArchiveSearcher archiveSearcher = (ArchiveSearcher) plugin.getModule(ArchiveSearcher.class);

            ArchiveSearch search = new ArchiveSearch();
            search.setParticipants(participant);
            search.setIncludeTimestamp(time);
            search.setRoom(room);
View Full Code Here

     *
     * @return the status the rebuilding (0 - 100) where 100 is complete.
     */
    public int getBuildProgress() {
        // Get handle on the Monitoring plugin
        MonitoringPlugin plugin =
            (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin(
                "monitoring");

        ArchiveIndexer archiveIndexer = (ArchiveIndexer)plugin.getModule(ArchiveIndexer.class);

        Future<Integer> future = archiveIndexer.getIndexRebuildProgress();
        if (future != null) {
            try {
                return future.get();
View Full Code Here

    public ConversationInfo getConversationInfo(long conversationID, boolean formatParticipants) {
        // Create ConversationInfo bean
        ConversationInfo info = new ConversationInfo();

        // Get handle on the Monitoring plugin
        MonitoringPlugin plugin =
            (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin(
                "monitoring");

        ConversationManager conversationmanager =
            (ConversationManager)plugin.getModule(ConversationManager.class);

        try {
            Conversation conversation = conversationmanager.getConversation(conversationID);
            info = toConversationInfo(conversation, formatParticipants);
        }
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.