01: /**
02: * $RCSfile: $
03: * $Revision: $
04: * $Date: $
05: *
06: * Copyright (C) 2007 Jive Software. All rights reserved.
07: *
08: * This software is published under the terms of the GNU Public License (GPL),
09: * a copy of which is included in this distribution.
10: */package org.jivesoftware.openfire.pep;
11:
12: import org.jivesoftware.openfire.IQHandlerInfo;
13: import org.jivesoftware.openfire.XMPPServer;
14: import org.jivesoftware.openfire.auth.UnauthorizedException;
15: import org.jivesoftware.openfire.handler.IQHandler;
16: import org.xmpp.packet.IQ;
17:
18: /**
19: * <p>
20: * An {@link IQHandler} used to implement XEP-0163: "Personal Eventing via Pubsub"
21: * Version 1.0
22: * </p>
23: *
24: * <p>
25: * An IQHandler can only handle one namespace in its IQHandlerInfo. However, PEP
26: * related packets are seen having a variety of different namespaces. This
27: * handler is needed to forward IQ packets with the
28: * <i>'http://jabber.org/protocol/pubsub#owner'</i> namespace to IQPEPHandler.
29: * </p>
30: *
31: * @author Armando Jagucki
32: *
33: */
34: public class IQPEPOwnerHandler extends IQHandler {
35:
36: private IQHandlerInfo info;
37:
38: public IQPEPOwnerHandler() {
39: super ("Personal Eventing 'pubsub#owner' Handler");
40: info = new IQHandlerInfo("pubsub",
41: "http://jabber.org/protocol/pubsub#owner");
42: }
43:
44: @Override
45: public IQHandlerInfo getInfo() {
46: return info;
47: }
48:
49: @Override
50: public IQ handleIQ(IQ packet) throws UnauthorizedException {
51: return XMPPServer.getInstance().getIQPEPHandler().handleIQ(
52: packet);
53: }
54: }
|