How to get the server date time of a LIVE MESSAGE?

Packet interceptors are part of internal Openfire api so you can write your own plugin that will append your packet interceptor into the interceptors chain. PacketInterceptor (Openfire 3.10.0 Javadoc)

and Openfire plugin dev guide:

Openfire: Plugin Developer Guide

And even related post about intercepting messages:

Packet Interceptor Plugin, will intercept every received message?

This topic is not solved, but it shows how to create and attach your interceptor.

I have tried to develop the plugin following the steps. But, unfortunately i dont have sucess. I did something wrong, and my server is not recognizing my class.

Can you help me with this?

Sure what is the error you are getting??

Remember that you entrypoint class must extend Plugin

and also you have to have your entrypoint class declared in plugin.xml file. Declaration must be as canonical class name(full.package.name.and.class.Name)

Actually i did everything that the documentation said. But something get wrong.

I using Eclipse IDE and started a Simple Java Project.

I´m trying to do a simple plugin just for debug first.

This is my class:

package org.jivesoftware.openfire.plugin;

import java.io.File;

import org.jivesoftware.openfire.container.Plugin;

import org.jivesoftware.openfire.container.PluginManager;

import org.jivesoftware.openfire.interceptor.InterceptorManager;

import org.jivesoftware.openfire.interceptor.PacketInterceptor;

import org.jivesoftware.openfire.interceptor.PacketRejectedException;

import org.jivesoftware.openfire.session.Session;

import org.jivesoftware.util.Log;

import org.xmpp.packet.Message;

import org.xmpp.packet.Packet;

public class MyPlugin implements Plugin, PacketInterceptor {

private InterceptorManager interceptorManager;

public MyPlugin() {

interceptorManager = InterceptorManager.getInstance();

}

public void destroyPlugin() {

interceptorManager.removeInterceptor(this);

}

@Override

public void initializePlugin(PluginManager arg0, File arg1) {

interceptorManager.addInterceptor(this);

}

@Override

public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed) throws PacketRejectedException {

if (packet instanceof Message) {

Log.debug(packet.toString());

}

}

}

This is my XML

<?xml version="1.0" encoding="UTF-8"?>

org.jivesoftware.openfire.plugin.MyPlugin

Example Plugin

This is an example plugin.

Jive Software

1.0

07/01/2006

<url>http://www.igniterealtime.org/projects/openfire/plugins.jsp</url>

3.0.0

gpl

However, in my project there is not a folder named “java” as I see in the others plugins.

My directory on workspace is workspace\MyPlugin\src\org\jivesoftware\openfire\plugin

And in the plugins the correct directory is something like this: MyPlugin\src\java\com\jivesoftware\openfire