
1287
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using External Resources
Las
t
upda
te
d 8/5/2010
Using the GatewayHelper object
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:
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):
Gateway buddy management methods
The following table describes the methods that you can use to manage the gateway’s buddy list:
Method
Description
getName
Returns the gateway’s user name.
getNickName
Returns the gateway’s display name (nickname).
getProtocolName
Returns the name of the instant messaging protocol (JABBER for XMPP, or SAMETIME).
numberOfMessagesReceived
Returns the number of messages received by the gateway since it was started.
numberOfMessagesSent
Returns the number of messages sent by the gateway since it was started.
setNickName
Sets the gateway’s display name (nickname).
Method
Description
getCustomAwayMessage
Returns the gateway’s custom away message if the
setStatus
method set it.
getStatusAsString
Returns the online status of the gateway.
getStatusTimeStamp
Returns the date/time that the gateway changed its online status.
isOnline
Returns True if the gateway is connected to the IM server; otherwise, returns false.
setStatus
Changes the gateway’s online status; for example, to away or idle.
Method
Description
addBuddy
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.