
1280
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using External Resources
Las
t
upda
te
d 8/5/2010
Note:
If you do not have a CFC method to handle any of the event types, specify the corresponding property without a
value. Use the following entry in the configuration file, for example, if you do not have a method to handle
IMServerMessage events: onIMServerMessageFunction=
Handling incoming messages
The IM event gateway handles five types of messages, and your CFC must implement a listener method for each
message type. The following table describes the message-handling CFC methods and the messages they handle. It lists
the default CFC method names; however, you can change the names in the gateway configuration file.
retries
-1
Integer number of times to retry connecting to the IM server on gateway startup or if the
Gateway gets disconnected.
0 = do not to retry
-1 = try forever
retryinterval
5
Real number of seconds to wait between connection attempts. The minimum is 1
second.
onIncomingMessageFu
nction
onIncomingMessage
Name of CFC method to call to handle an incoming message. If you specify the property
without a value, such as “onIncomingMessageFunction=”, the gateway does not send
this event to a CFC.
onAddBuddyRequestFu
nction
onAddBuddyRequest
Name of CFC method to call to handle an incoming buddy request. If you specify the
property without a value, the gateway does not send this event to a CFC.
onAddBuddyResponseF
unction
onAddBuddyResponse
Name of CFC method to call to handle an incoming response to a buddy request sent by
ColdFusion. If you specify the property without a value, the gateway does not send this
event to a CFC.
onBuddyStatusFunction
onBuddyStatus
Name of CFC method to call to handle an incoming buddy status message, such as If you
specify the property without a value, the gateway does not send this event to a CFC.
onIMServerMessageFun
ction
onIMServerMessage
Name of CFC method to call to handle an incoming message method. If you specify the
property without a value, the gateway does not send this event to a CFC.
CFC method
Description
onIncomingMessage
Standard message from an IM user. The application processes the message body appropriately; for
example, it could display the message in an interface window.
This method can return a response message to the sender.
onAddBuddyRequest
Request from another IM user to add your application’s IM ID to their buddy list. The CFC must
determine whether to accept or reject the request, or to take no action. An action is not always
appropriate in cases where the request must be reviewed offline for approval and responses are
sent at a later time.
The CFC returns a message with the decision as a command value and optionally a text message
specifying the reason. If you accept the request, the requestor automatically gets added to the list
of IDs that can get status information for the gateway. If you specify no action, ColdFusion does not
respond.
Property
Default value
Description
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...