Package tigase.server
Enum Class Command
- All Implemented Interfaces:
Serializable
,Comparable<Command>
,Constable
Helper enum to make it easier to operate on packets with ad-hoc commands. It allows to create a packet with command,
add and retrieve command data field values, set actions and so on.
It contains predefined set of commands used internally by the Tigase server and also 'OTHER' command which refers all other not predefined commands.
Most of the implementation details, constants and parameters is based on the XEP-0050 for ad-hoc commands protocol. Please refer to the XEP for more details.
Created: Thu Feb 9 20:52:02 2006
It contains predefined set of commands used internally by the Tigase server and also 'OTHER' command which refers all other not predefined commands.
Most of the implementation details, constants and parameters is based on the XEP-0050 for ad-hoc commands protocol. Please refer to the XEP for more details.
Created: Thu Feb 9 20:52:02 2006
- Author:
- Artur Hefczyc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Ad-hoc command actions ad defined in the XEP-0050.static class
static enum
Data form-types as defined in the XEP-0050.static enum
Ad-hoc command statuses as defined in the XEP-0050.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCommand used to set a broadcast message to all registered local users.Command used to set a broadcast message to all online users.Sends a command from SM to the connection holder to confirm whether the connection is still active.Command sent from the session manager to a client manager to close the client connection.This is depreciated command sent between components in the Tigase server for service discovery handling.Command sent between a connection manager and the session manager to retrieve stream features.Command used by the StatisticsCollector to provide server statistics through ad-hoc command.Identifies all other, not predefined commands.Command used to redirect packets from a connection manager to other than default session manager.Command sent from the session manager to a connection manager to start TLS handshaking over the client connection.Command sent from the session manager to a connection manager to start zlib compression on the connection stream.Command sent from a connection manager to the session manager when a connection or stream has been closed.Command sent from a connection manager to the session manager after last packet from closed connection stream has been sent.Command sent to SessionManager to change connectionId of existing session.Command sent from a connection manager to the session manager when a new stream from the client has been opened.Command sent from connection manager to the session manager after TLS handshake if client sent certificate.Command sent from session manager to the connection manager after successful user login.Command sent to the session manager from an external entity to activate a user session with the connection end-point at the given address.Command sent to the VHostManager to reload virtual hosts from the database.Command sent to the VHostManager to remove existing virtual host.Command sent to the VHostManager to add or update existing virtual host. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAction
(Packet packet, Command.Action action) static void
addCheckBoxField
(Packet packet, String f_name, boolean f_value) static void
addFieldMultiValue
(Packet packet, String f_name, Throwable ex) static void
addFieldMultiValue
(Packet packet, String f_name, List<String> f_value) A simple method for adding a multi-line (text-multi) data field to the command data form.static void
static void
addFieldValue
(Packet packet, String f_name, String f_value) Simple method for adding a new field to the command data form.static void
addFieldValue
(Packet packet, String f_name, String[] f_values, String label, String[] labels, String[] options) This method allows to add a new multi-option-select-many data field to the command data form.static void
addFieldValue
(Packet packet, String f_name, String f_value, String type) static void
static void
addFieldValue
(Packet packet, String f_name, String f_value, String label, String[] labels, String[] options) This method allows to add a new multi-option-select-one data field to the command data form.static void
addFieldValue
(Packet packet, String f_name, String f_value, String label, String[] labels, String[] options, String type) static void
addHiddenField
(Packet packet, String f_name, String f_value) static void
addInstructions
(Packet packet, String instructions) static void
static void
addTextField
(Packet packet, String f_name, String f_value) static void
protected static Element
createCommandEl
(String node, Command.DataType data_type) static Element
createIqCommand
(JID from, JID to, StanzaType type, String id, String node, Command.DataType data_type) static Command.Action
static boolean
getCheckBoxFieldValue
(Packet packet, String f_name) static Element
static String
getFieldKeyStartingWith
(Packet packet, String f_name) static String
getFieldValue
(Packet packet, String f_name) static String
getFieldValue
(Packet packet, String f_name, boolean debug) static String[]
getFieldValues
(Packet packet, String f_name) getPacket
(JID from, JID to, StanzaType type, String id) Method returns instance of a Packet with command element added.getPacket
(JID from, JID to, StanzaType type, String id, Command.DataType data_type) Method returns instance of a Packet with command element added.static boolean
removeFieldValue
(Packet packet, String f_name) static void
static void
static void
setStatus
(Packet packet, Command.Status status) static Command
static Command
Returns the enum constant of this class with the specified name.static Command[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STREAM_OPENED
Command sent from a connection manager to the session manager when a new stream from the client has been opened. -
TLS_HANDSHAKE_COMPLETE
Command sent from connection manager to the session manager after TLS handshake if client sent certificate. -
USER_LOGIN
Command sent from session manager to the connection manager after successful user login. -
STREAM_CLOSED
Command sent from a connection manager to the session manager when a connection or stream has been closed. -
STREAM_CLOSED_UPDATE
-
STREAM_FINISHED
Command sent from a connection manager to the session manager after last packet from closed connection stream has been sent. -
CHECK_USER_CONNECTION
Sends a command from SM to the connection holder to confirm whether the connection is still active. Expects result for ok, error or timeout if the connection is no longer active. -
STARTTLS
Command sent from the session manager to a connection manager to start TLS handshaking over the client connection. -
STARTZLIB
Command sent from the session manager to a connection manager to start zlib compression on the connection stream. -
GETFEATURES
Command sent between a connection manager and the session manager to retrieve stream features. -
GETDISCO
This is depreciated command sent between components in the Tigase server for service discovery handling. -
CLOSE
Command sent from the session manager to a client manager to close the client connection. -
GETSTATS
Command used by the StatisticsCollector to provide server statistics through ad-hoc command. -
USER_STATUS
Command sent to the session manager from an external entity to activate a user session with the connection end-point at the given address. -
BROADCAST_TO_ONLINE
Command used to set a broadcast message to all online users. -
BROADCAST_TO_ALL
Command used to set a broadcast message to all registered local users. -
REDIRECT
Command used to redirect packets from a connection manager to other than default session manager. (Mostly used in the clustering.) -
VHOSTS_RELOAD
Command sent to the VHostManager to reload virtual hosts from the database. -
VHOSTS_UPDATE
Command sent to the VHostManager to add or update existing virtual host. -
VHOSTS_REMOVE
Command sent to the VHostManager to remove existing virtual host. -
STREAM_MOVED
Command sent to SessionManager to change connectionId of existing session. -
OTHER
Identifies all other, not predefined commands.
-
-
Field Details
-
COMMAND_EL
- See Also:
-
XMLNS
- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
addAction
-
addCheckBoxField
-
addFieldMultiValue
A simple method for adding a multi-line (text-multi) data field to the command data form. Only field name (variable name) and field default value can be set.- Parameters:
packet
- is aPacket
instance of the ad-hoc command request to be modified.f_name
- is aString
instance with the field name. In ad-hoc command terms this is a variable name. This field name (variable name) will be also displayed as the field label.f_value
- is a list with lines of text to be displayed as a multi-line field content.
-
addFieldMultiValue
-
addFieldMultiValue
-
addFieldValue
Simple method for adding a new field to the command data form. Only field name (variable name) and field default value can be set.- Parameters:
packet
- is aPacket
instance of the ad-hoc command request to be modified.f_name
- is aString
instance with the field name. In ad-hoc command terms this is a variable name. This field name (variable name) will be also displayed as the field label.f_value
- is aString
instance with the field default value.
-
addFieldValue
public static void addFieldValue(Packet packet, String f_name, String f_value, String label, String[] labels, String[] options) This method allows to add a new multi-option-select-one data field to the command data form. This is much more complex implementation allowing to set a field label and labels for all provided field options. It allows the end-user to select a single option from a given list.- Parameters:
packet
- is aPacket
instance of the ad-hoc command request to be modified.f_name
- is aString
instance with the field name. In ad-hoc command terms this is a variable name.f_value
- is aString
instance with the field default value. It must match one of the options vaulues provided as a list in 'options' parameter.label
- is aString
instance with the field label. This time a label set here is displayed to the user instead of the field name (variable name). This is useful if the variable name is not suitable or clear enough to the end-user.labels
- is an array with options labels which are displayed to the end-user upon presenting the selection options.options
- is an array with options values to be selected by the end-user. Normally these values are not displayed to the end-user. Only options labels are.
-
addFieldValue
public static void addFieldValue(Packet packet, String f_name, String[] f_values, String label, String[] labels, String[] options) This method allows to add a new multi-option-select-many data field to the command data form. This is much more complex implementation allowing to set a field label and labels for all provided field options. It allows the end-user to select many options from the given list.- Parameters:
packet
- is aPacket
instance of the ad-hoc command request to be modified.f_name
- is aString
instance with the field name. In ad-hoc command terms this is a variable name.f_values
- is an array of default values which are presented to the end user as preselected options. They must match options vaulues provided as a list in 'options' parameter.label
- is aString
instance with the field label. This time a label set here is displayed to the user instead of the field name (variable name). This is useful if the variable name is not suitable or clear enough to the end-user.labels
- is an array with options labels which are displayed to the end-user upon presenting the selection options.options
- is an array with options values to be selected by the end-user. Normally these values are not displayed to the end-user. Only options labels are.
-
addFieldValue
-
addFieldValue
-
addFieldValue
-
addHiddenField
-
addInstructions
-
addNote
-
addTextField
-
addTitle
-
createCommandEl
-
createIqCommand
public static Element createIqCommand(JID from, JID to, StanzaType type, String id, String node, Command.DataType data_type) -
getAction
-
getCheckBoxFieldValue
-
getData
-
getData
-
getFieldKeyStartingWith
-
getFieldValue
-
getFieldValue
-
getFieldValues
-
removeFieldValue
-
setData
-
setData
-
setStatus
-
valueof
-
getPacket
Method returns instance of a Packet with command element added. WARNING: Returned packet will not have any XMLNS set! -
getPacket
Method returns instance of a Packet with command element added. WARNING: Returned packet will not have any XMLNS set!
-