|
Openfire 3.3.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.openfire.container.BasicModule
org.jivesoftware.openfire.handler.IQHandler
org.jivesoftware.openfire.disco.IQDiscoInfoHandler
public class IQDiscoInfoHandler
IQDiscoInfoHandler is responsible for handling disco#info requests. This class holds a map with the main entities and the associated DiscoInfoProvider. We are considering the host of the recipient JIDs as main entities. It's the DiscoInfoProvider responsibility to provide information about the JID's name together with any possible requested node.
For example, let's have in the entities map the following entries: "localhost" and "conference.localhost". Associated with each entry we have different DiscoInfoProviders. Now we receive a disco#info request for the following JID: "room@conference.localhost" which is a disco request for a MUC room. So IQDiscoInfoHandler will look for the DiscoInfoProvider associated with the JID's host which in this case is "conference.localhost". Once we have located the provider we will delegate to the provider the responsibility to provide the info specific to the JID's name which in this case is "room". Among the information that a room could provide we could find its identity and the features it supports (e.g. 'muc_passwordprotected', 'muc_unmoderated', etc.). Finally, after we have collected all the information provided by the provider we will add it to the reply. On the other hand, if no provider was found or the provider has no information for the requested name/node then a not-found error will be returned.
Field Summary |
---|
Fields inherited from class org.jivesoftware.openfire.handler.IQHandler |
---|
deliverer, sessionManager |
Constructor Summary | |
---|---|
IQDiscoInfoHandler()
|
Method Summary | |
---|---|
boolean |
addServerFeature(String namespace)
Adds one specific feature to the information returned whenever a disco for information is made against the server. |
IQHandlerInfo |
getInfo()
Returns the handler information to help generically handle IQ packets. |
IQ |
handleIQ(IQ packet)
Handles the received IQ packet. |
void |
initialize(XMPPServer server)
Initializes the basic module. |
protected void |
removeProvider(String name)
Removes the DiscoInfoProvider related to a given entity. |
void |
removeServerFeature(String namespace)
Removes a feature from the information returned whenever a disco for information is made against the server. |
void |
removeServerNodeInfoProvider(String node)
Removes the DiscoInfoProvider to use when a disco#info packet is sent to the server itself and the specified node. |
protected void |
setProvider(String name,
DiscoInfoProvider provider)
Sets that a given DiscoInfoProvider will provide information about a given entity. |
void |
setServerNodeInfoProvider(String node,
DiscoInfoProvider provider)
Sets the DiscoInfoProvider to use when a disco#info packet is sent to the server itself and the specified node. |
Methods inherited from class org.jivesoftware.openfire.handler.IQHandler |
---|
process |
Methods inherited from class org.jivesoftware.openfire.container.BasicModule |
---|
destroy, getName, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IQDiscoInfoHandler()
Method Detail |
---|
public IQHandlerInfo getInfo()
IQHandler
getInfo
in class IQHandler
public IQ handleIQ(IQ packet)
IQHandler
handleIQ
in class IQHandler
packet
- the IQ packet to handle.
public void setServerNodeInfoProvider(String node, DiscoInfoProvider provider)
node
- the node that the provider will handle.provider
- the DiscoInfoProvider that will handle disco#info packets sent with the
specified node.public void removeServerNodeInfoProvider(String node)
node
- the node that the provider was handling.protected void setProvider(String name, DiscoInfoProvider provider)
name
- the name of the entity.provider
- the DiscoInfoProvider that will provide the entity's information.protected void removeProvider(String name)
name
- the name of the entity.public boolean addServerFeature(String namespace)
namespace
- the namespace identifying the new server feature.
public void removeServerFeature(String namespace)
namespace
- the namespace of the feature to be removed.public void initialize(XMPPServer server)
BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize
in interface Module
initialize
in class IQHandler
server
- the server hosting this module.
|
Openfire 3.3.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |