// Path: src/main/java/com/enernoc/rnd/openfire/cluster/task/BroadcastTask.java
// public class BroadcastTask extends PacketTask<Message> {
// 
// 	public BroadcastTask() {}
// 	public BroadcastTask( Message msg ) { super(msg); }
// 
// 	public void run() {
// 		XMPPServer.getInstance().getRoutingTable().broadcastPacket( packet, true );
// 	}
// 
// 	@Override
// 	public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
// 		packet = new Message( super.readXML(in), true );
// 	}
// 
// 	@Override
// 	public void writeExternal(ObjectOutput out) throws IOException {
// 		ExternalizableUtil.getInstance().writeSafeUTF( out, packet.toXML() );
// 	}
// }
// 
// Path: src/main/java/com/enernoc/rnd/openfire/cluster/task/PacketRouterTask.java
// public class PacketRouterTask extends PacketTask<Packet> {
// 
// 	public PacketRouterTask() {}
// 	public PacketRouterTask( Packet packet ) {
// 		super( packet );
// 	}
// 
// 	public void run() {
// 		XMPPServer.getInstance().getPacketRouter().route( packet );
// 	}
// }


import org.jivesoftware.openfire.RemotePacketRouter;
import org.jivesoftware.util.cache.CacheFactory;
import org.xmpp.packet.JID;
import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
import com.enernoc.rnd.openfire.cluster.task.BroadcastTask;
import com.enernoc.rnd.openfire.cluster.task.PacketRouterTask;
/**
*   Licensed under the Apache License, Version 2.0 (the "License");
*   you may not use this file except in compliance with the License.
*   You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*   Unless required by applicable law or agreed to in writing, software
*   distributed under the License is distributed on an "AS IS" BASIS,
*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*   See the License for the specific language governing permissions and
*   limitations under the License.
**/
package com.enernoc.rnd.openfire.cluster;



public class ClusterPacketRouter implements RemotePacketRouter {

	public void broadcastPacket( Message packet ) {
// Path: src/main/java/com/enernoc/rnd/openfire/cluster/task/BroadcastTask.java
// public class BroadcastTask extends PacketTask<Message> {
// 
// 	public BroadcastTask() {}
// 	public BroadcastTask( Message msg ) { super(msg); }
// 
// 	public void run() {
// 		XMPPServer.getInstance().getRoutingTable().broadcastPacket( packet, true );
// 	}
// 
// 	@Override
// 	public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
// 		packet = new Message( super.readXML(in), true );
// 	}
// 
// 	@Override
// 	public void writeExternal(ObjectOutput out) throws IOException {
// 		ExternalizableUtil.getInstance().writeSafeUTF( out, packet.toXML() );
// 	}
// }
// 
// Path: src/main/java/com/enernoc/rnd/openfire/cluster/task/PacketRouterTask.java
// public class PacketRouterTask extends PacketTask<Packet> {
// 
// 	public PacketRouterTask() {}
// 	public PacketRouterTask( Packet packet ) {
// 		super( packet );
// 	}
// 
// 	public void run() {
// 		XMPPServer.getInstance().getPacketRouter().route( packet );
// 	}
// }


// Path: src/main/java/com/enernoc/rnd/openfire/cluster/ClusterPacketRouter.java
import org.jivesoftware.openfire.RemotePacketRouter;
import org.jivesoftware.util.cache.CacheFactory;
import org.xmpp.packet.JID;
import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
import com.enernoc.rnd.openfire.cluster.task.BroadcastTask;
import com.enernoc.rnd.openfire.cluster.task.PacketRouterTask;

/**
*   Licensed under the Apache License, Version 2.0 (the "License");
*   you may not use this file except in compliance with the License.
*   You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*   Unless required by applicable law or agreed to in writing, software
*   distributed under the License is distributed on an "AS IS" BASIS,
*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*   See the License for the specific language governing permissions and
*   limitations under the License.
**/
package com.enernoc.rnd.openfire.cluster;



public class ClusterPacketRouter implements RemotePacketRouter {

	public void broadcastPacket( Message packet ) {
		CacheFactory.doClusterTask( new BroadcastTask(packet) );