|
Openfire 3.5.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.container.BasicModule org.jivesoftware.openfire.handler.IQHandler org.jivesoftware.openfire.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.openfire.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<DiscoItem> |
getItems(String name,
String node,
JID senderJID)
Returns an Iterator (of DiscoItem) 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.openfire.handler.IQHandler |
---|
process |
Methods inherited from class org.jivesoftware.openfire.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 IQHandler
packet
- 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 IQHandler
public Iterator<String> getFeatures()
ServerFeaturesProvider
getFeatures
in interface ServerFeaturesProvider
public Iterator<org.dom4j.Element> getIdentities(String name, String node, JID senderJID)
DiscoInfoProvider
getIdentities
in interface DiscoInfoProvider
name
- 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 DiscoInfoProvider
name
- 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 DiscoInfoProvider
name
- 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 DiscoInfoProvider
name
- the recipient JID's name.node
- the requested disco node.senderJID
- the XMPPAddress of user that sent the disco info request.
public Iterator<DiscoItem> getItems(String name, String node, JID senderJID)
DiscoItemsProvider
getItems
in interface DiscoItemsProvider
name
- 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)
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.public void start() throws IllegalStateException
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
IllegalStateException
- If start is called before initialize
successfully returnspublic void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
public void addCommand(AdHocCommand command)
command
- the new ad-hoc command to add.public void removeCommand(AdHocCommand command)
command
- the ad-hoc command to remove.
|
Openfire 3.5.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |