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