The CFML GetGatewayHelper function returns a GatewayHelper object with several methods that manage your gateway and buddy list. The GatewayHelper methods let you do the following:
- Get and set gateway configuration information and get gateway statistics.
- Get and set the gateway online status.
- Manage the gateway's buddy list
- Manage permissions for others to get information about the gateway status.
The following sections briefly describe the class methods. For detailed information about each method, see IM Gateway GatewayHelper class methods in the CFML Reference.
Gateway configuration information and statistics methods
The following table describes the methods that you can use to get and set configuration information and get gateway statistics:
Method |
Description |
---|---|
Returns the gateway's user name. |
|
Returns the gateway's display name (nickname). |
|
Returns the name of the instant messaging protocol (JABBER for XMPP, or SAMETIME). |
|
Returns the number of messages received by the gateway since it was started. |
|
Returns the number of messages sent by the gateway since it was started. |
|
Sets the gateway's display name (nickname). |
Gateway online status methods
The following table describes the methods that you can use to get and set the gateway's online availability status (presence information):
Method |
Description |
---|---|
Returns the gateway's custom away message if the setStatus method set it. |
|
Returns the online status of the gateway. |
|
Returns the date/time that the gateway changed its online status. |
|
Returns True if the gateway is connected to the IM server; otherwise, returns false. |
|
Changes the gateway's online status; for example, to away or idle. |
Gateway buddy management methods
The following table describes the methods that you can use to manage the gateway's buddy list:
Method |
Description |
---|---|
Adds a buddy to the gateway's buddy list and tells the IM server to send the gateway messages with the buddy's online state. |
|
Gets information about the specified user from the buddy list, deny list, and permit list. |
|
Returns the gateway's buddy list. |
|
Removes the specified user name from the gateway's buddy list and tells the IM server to stop sending the gateway messages with the user's online state. |
Gateway permission management methods
The IM gateways can manage the information that other users can get about the gateway's online status.
XMPP permission management is included in the XMPP 1.0 specification, but several XMPP servers that were available at the time of the ColdFusion release do not support permission management. |
The following table describes the gateway permission management methods:
Method |
Description |
---|---|
Tells the IM server to add the specified user to the gateway's deny list. If the permitMode is DENY_SOME, these users cannot receive messages on the gateway's state. |
|
Tells the IM server to add the specified user to the server's permit list. If the permitMode is PERMIT_SOME, these users receive messages on the gateway's state. |
|
Returns the list of users that the server has been told not to send state information to. |
|
Returns the list of users that the server has been told to send state information to. |
|
Gets the gateway's permit mode from the IM server. The permit mode determines whether all users can get the gateway's online state information, or whether the server uses a permit list or a deny list to control which users get state information. |
|
Removes the user from the gateway's deny list. |
|
Removes the user from the gateway's permit list. |
|
Sets the gateway's permit mode on the IM server. |
GatewayHelper example
This example lets you use the XMPP or SameTime GatewayHelper class to get and set status and other information, including managing buddy lists and view permissions lists.
|