|
Wildfire 3.1.1 Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.wildfire.container.BasicModule
org.jivesoftware.wildfire.handler.IQHandler
org.jivesoftware.wildfire.commands.AdHocCommandHandler
public class AdHocCommandHandler
An AdHocCommandHandler is responsbile for providing discoverable information about the supported commands and for handling commands requests. This is an implementation of JEP-50: Ad-Hoc Commands.
Ad-hoc commands that require user interaction will have one or more stages. For each stage the
user will complete a data form and send it back to the server. The data entered by the user is
kept in a SessionData. Instances of AdHocCommand are stateless. In order to prevent
"bad" users from consuming all system memory there exists a limit of simultaneous commands that
a user might perform. Configure the system property "xmpp.command.limit" to control
this limit. User sessions will also timeout and their data destroyed if they have not been
executed within a time limit since the session was created. The default timeout value is 10
minutes. The timeout value can be modified by setting the system property
"xmpp.command.timeout".
New commands can be added dynamically by sending the message addCommand(AdHocCommand).
The command will immediatelly appear in the disco#items list and might be executed by those
users with enough execution permissions.
| Field Summary |
|---|
| Fields inherited from class org.jivesoftware.wildfire.handler.IQHandler |
|---|
deliverer, sessionManager |
| Constructor Summary | |
|---|---|
AdHocCommandHandler()
|
|
| Method Summary | |
|---|---|
void |
addCommand(AdHocCommand command)
Adds a new command to the list of supported ad-hoc commands by this server. |
XDataFormImpl |
getExtendedInfo(String name,
String node,
JID senderJID)
Returns an XDataForm with the extended information about the entity or null if none. |
Iterator<String> |
getFeatures()
Returns an Iterator (of String) with the supported features by the server. |
Iterator<String> |
getFeatures(String name,
String node,
JID senderJID)
Returns an Iterator (of String) with the supported features. |
Iterator<org.dom4j.Element> |
getIdentities(String name,
String node,
JID senderJID)
Returns an Iterator (of Element) with the target entity's identities. |
IQHandlerInfo |
getInfo()
Returns the handler information to help generically handle IQ packets. |
Iterator<org.dom4j.Element> |
getItems(String name,
String node,
JID senderJID)
Returns an Iterator (of Element) with the target entity's items or null if none. |
IQ |
handleIQ(IQ packet)
Handles the received IQ packet. |
boolean |
hasInfo(String name,
String node,
JID senderJID)
Returns true if we can provide information related to the requested name and node. |
void |
initialize(XMPPServer server)
Initializes the basic module. |
void |
removeCommand(AdHocCommand command)
Removes the command from the list of ad-hoc commands supported by this server. |
void |
start()
Starts the basic module. |
void |
stop()
Stops the basic module. |
| Methods inherited from class org.jivesoftware.wildfire.handler.IQHandler |
|---|
process |
| Methods inherited from class org.jivesoftware.wildfire.container.BasicModule |
|---|
destroy, getName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AdHocCommandHandler()
| Method Detail |
|---|
public IQ handleIQ(IQ packet)
throws UnauthorizedException
IQHandler
handleIQ in class IQHandlerpacket - the IQ packet to handle.
UnauthorizedException - if the user that sent the packet is not
authorized to request the given operation.public IQHandlerInfo getInfo()
IQHandler
getInfo in class IQHandlerpublic Iterator<String> getFeatures()
ServerFeaturesProvider
getFeatures in interface ServerFeaturesProvider
public Iterator<org.dom4j.Element> getIdentities(String name,
String node,
JID senderJID)
DiscoInfoProvider
getIdentities in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.
public Iterator<String> getFeatures(String name,
String node,
JID senderJID)
DiscoInfoProvider
getFeatures in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.
public XDataFormImpl getExtendedInfo(String name,
String node,
JID senderJID)
DiscoInfoProvider
getExtendedInfo in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.
public boolean hasInfo(String name,
String node,
JID senderJID)
DiscoInfoProvider
hasInfo in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.
public Iterator<org.dom4j.Element> getItems(String name,
String node,
JID senderJID)
DiscoItemsProvider
getItems in interface DiscoItemsProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco items request.
public void initialize(XMPPServer server)
BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize in interface Moduleinitialize in class IQHandlerserver - the server hosting this module.
public void start()
throws IllegalStateException
BasicModuleStarts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start in interface Modulestart in class BasicModuleIllegalStateException - If start is called before initialize
successfully returnspublic void stop()
BasicModuleStops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop in interface Modulestop in class BasicModulepublic void addCommand(AdHocCommand command)
command - the new ad-hoc command to add.public void removeCommand(AdHocCommand command)
command - the ad-hoc command to remove.
|
Wildfire 3.1.1 Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||