public final class AdHocCommandManager
extends org.jivesoftware.smack.Manager
getAddHocCommandsManager(XMPPConnection)
in order to
get an instance of this class.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE |
Modifier and Type | Method and Description |
---|---|
DiscoverItems |
discoverCommands(org.jxmpp.jid.Jid jid)
Discover the commands of an specific JID.
|
static AdHocCommandManager |
getAddHocCommandsManager(org.jivesoftware.smack.XMPPConnection connection)
Returns the
AdHocCommandManager related to the
connection . |
RemoteCommand |
getRemoteCommand(org.jxmpp.jid.Jid jid,
java.lang.String node)
Returns a command that represents an instance of a command in a remote
host.
|
void |
registerCommand(java.lang.String node,
java.lang.String name,
java.lang.Class<? extends LocalCommand> clazz)
Registers a new command with this command manager, which is related to a
connection.
|
void |
registerCommand(java.lang.String node,
java.lang.String name,
LocalCommandFactory factory)
Registers a new command with this command manager, which is related to a
connection.
|
public static final java.lang.String NAMESPACE
public static AdHocCommandManager getAddHocCommandsManager(org.jivesoftware.smack.XMPPConnection connection)
AdHocCommandManager
related to the
connection
.connection
- the XMPP connection.public void registerCommand(java.lang.String node, java.lang.String name, java.lang.Class<? extends LocalCommand> clazz)
node
is an unique identifier of that command for
the connection related to this command manager. The name
is the
human readable name of the command. The class
is the class of
the command, which must extend LocalCommand
and have a default
constructor.node
- the unique identifier of the command.name
- the human readable name of the command.clazz
- the class of the command, which must extend LocalCommand
.public void registerCommand(java.lang.String node, java.lang.String name, LocalCommandFactory factory)
node
is an unique identifier of that
command for the connection related to this command manager. The name
is the human readable name of the command. The factory
generates
new instances of the command.node
- the unique identifier of the command.name
- the human readable name of the command.factory
- a factory to create new instances of the command.public DiscoverItems discoverCommands(org.jxmpp.jid.Jid jid) throws org.jivesoftware.smack.XMPPException, org.jivesoftware.smack.SmackException, java.lang.InterruptedException
jid
is a
full JID.jid
- the full JID to retrieve the commands for.org.jivesoftware.smack.XMPPException
- if the operation failed for some reason.org.jivesoftware.smack.SmackException
- if there was no response from the server.java.lang.InterruptedException
- if the calling thread was interrupted.public RemoteCommand getRemoteCommand(org.jxmpp.jid.Jid jid, java.lang.String node)
jid
- the full JID of the host of the remote commandnode
- the identifier of the command