public final class Command
extends java.lang.Object
The implementation of the <command/>
element in the http://jabber.org/protocol/commands
namespace.
This class is immutable.
Modifier and Type | Class and Description |
---|---|
static class |
Command.Action
Represents a command action.
|
static class |
Command.BadAction
The responding JID cannot accept the specified action.
|
static class |
Command.BadLocale
The responding JID cannot accept the specified language/locale.
|
static class |
Command.BadPayload
The responding JID cannot accept the specified payload (e.g. the data form did not provide one or more required fields).
|
static class |
Command.BadSessionId
The responding JID cannot accept the specified sessionid.
|
static class |
Command.MalformedAction
The responding JID does not understand the specified action.
|
static class |
Command.Note
Represents a note associated with a command.
|
static class |
Command.SessionExpired
The requesting JID specified a sessionid that is no longer active (either because it was completed, canceled, or timed out).
|
static class |
Command.Status
Represents the status of the command.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE
|
Constructor and Description |
---|
Command(java.lang.String node,
Command.Action action)
Creates a command request for simple execution.
|
Command(java.lang.String node,
java.lang.String sessionId,
Command.Action action,
java.util.List<java.lang.Object> payloads)
Creates a command request, which is created by the requester.
|
Command(java.lang.String node,
java.lang.String sessionId,
Command.Action action,
java.util.List<java.lang.Object> payloads,
java.util.Locale language,
java.util.List<Command.Note> notes)
Creates a command request, which is created by the requester.
|
Command(java.lang.String node,
java.lang.String sessionId,
Command.Status status,
java.util.Collection<Command.Action> actions,
Command.Action defaultAction,
java.util.List<java.lang.Object> payloads)
Creates a command result, which is created by the responder.
|
Command(java.lang.String node,
java.lang.String sessionId,
Command.Status status,
java.util.Collection<Command.Action> actions,
Command.Action defaultAction,
java.util.List<java.lang.Object> payloads,
java.util.Locale language,
java.util.List<Command.Note> notes)
Creates a command result, which is created by the responder.
|
Modifier and Type | Method and Description |
---|---|
Command.Action |
getAction()
Gets the action, which is used by the requester.
|
java.util.Collection<Command.Action> |
getActions()
Gets the possible command actions, which are provided by the responder.
|
Command.Action |
getDefaultAction()
Gets the default action or null, if there is no default action.
|
java.util.Locale |
getLanguage()
Gets the language.
|
java.lang.String |
getNode()
Gets the node.
|
java.util.List<Command.Note> |
getNotes()
Gets the notes.
|
java.util.List<java.lang.Object> |
getPayloads()
Gets the command payload.
|
java.lang.String |
getSessionId()
Gets the session id.
|
Command.Status |
getStatus()
Gets the status of the command.
|
public static final java.lang.String NAMESPACE
public Command(java.lang.String node, Command.Action action)
Creates a command request for simple execution.
node
- The node.action
- The action. If null, Command.Action.EXECUTE
is implied.public Command(java.lang.String node, java.lang.String sessionId, Command.Action action, java.util.List<java.lang.Object> payloads)
Creates a command request, which is created by the requester.
node
- The node.sessionId
- The session id.action
- The action. If null, Command.Action.EXECUTE
is implied.payloads
- The payloads.public Command(java.lang.String node, java.lang.String sessionId, Command.Action action, java.util.List<java.lang.Object> payloads, java.util.Locale language, java.util.List<Command.Note> notes)
Creates a command request, which is created by the requester.
node
- The node.sessionId
- The session id.action
- The action. If null, Command.Action.EXECUTE
is implied.payloads
- The payloads.language
- The language.notes
- The notes.public Command(java.lang.String node, java.lang.String sessionId, Command.Status status, java.util.Collection<Command.Action> actions, Command.Action defaultAction, java.util.List<java.lang.Object> payloads)
Creates a command result, which is created by the responder.
node
- The node.sessionId
- The session id.status
- The status.actions
- The actions, which are possible to execute by the requester.defaultAction
- The default action, which should be executed by the requester.payloads
- The payloads.public Command(java.lang.String node, java.lang.String sessionId, Command.Status status, java.util.Collection<Command.Action> actions, Command.Action defaultAction, java.util.List<java.lang.Object> payloads, java.util.Locale language, java.util.List<Command.Note> notes)
Creates a command result, which is created by the responder.
node
- The node.sessionId
- The session id.status
- The status.actions
- The actions, which are possible to execute by the requester.defaultAction
- The default action, which should be executed by the requester.payloads
- The payloads.language
- The language.notes
- The notes.public final java.util.List<java.lang.Object> getPayloads()
Gets the command payload.
public final Command.Action getAction()
Gets the action, which is used by the requester.
public final java.lang.String getNode()
Gets the node.
public final Command.Status getStatus()
Gets the status of the command.
public final java.lang.String getSessionId()
Gets the session id.
public final java.util.Collection<Command.Action> getActions()
Gets the possible command actions, which are provided by the responder.
public final Command.Action getDefaultAction()
Gets the default action or null, if there is no default action.
public final java.util.List<Command.Note> getNotes()
Gets the notes.
public final java.util.Locale getLanguage()
Gets the language.
The “xml:lang” attribute specifies the language/locale this <command/>
is intended for. This element MAY be specified by the requester to request a specific language/locale, and SHOULD be included by the responder to indicate the language/locale in use.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.