public interface ControlHandler
Registering a handler to receive control messages is done by invoking the
RT_Consumer.setControlHandler(com.factset.rt.ControlHandler)
method. The API
invokes the onControl(boolean, com.factset.rt.RT_Message)
method when control
events occur. onControl
will only be invoked during a call to
the RT_Consumer.dispatch()
methods.
Control messages typically indicate events such as connection or
disconnection of an RT_Consumer
, a service attachment, or other
such events. The type of event is indicated in the key of the message,
obtained by the RT_Message.getKey()
method. Additional data fields may
be present depending on the type of control message.
The following table shows the
possible control messages that can be delivered to a
ControlHandler
instance:
Control Type | Meaning | Additional Information |
---|---|---|
"CONNECTED" | The TCP connection to the DataFeed server has been opened. | The current active service names are contained in the message. Each
service name is stored in a field with the
FIDS.SERVICE_NAME field identifier. |
"DISCONNECTED" | The TCP connection to the DataFeed server has been closed. | The error that caused the disconnection can be obtained via the
RT_Message.getError() method. |
"SERVICE_ENABLE" | New services have become available for requests. | The new service names are contained in the message. Each service
name is stored in a field with the
FIDS.SERVICE_NAME field identifier. |
"SERVICE_DISCONNECT" | Services have become stale. Existing subscriptions will now transition to stale. | The stale service names are contained in the message. Each service
name is stored in a field with the
FIDS.SERVICE_NAME field identifier. |
"SERVICE_DISABLE" | The services are no longer accepting any new subscriptions. | The disabled service names are contained in the message. Each
service name is stored in a field with the
FIDS.SERVICE_NAME field identifier. |
"TERMINATE" | The FactSet data server is requesting the application terminate its connection. | This is typical when the authentication for an asynchronous
connection has failed. RT_Consumer.disconnect() MUST be
invoked when receiving this message. If it is not, the API will
disconnect on its behalf. |
RT_Consumer
Modifier and Type | Method and Description |
---|---|
void |
onControl(boolean isConnected,
RT_Message controlMsg)
Invoked by an
RT_Consumer when a control event has occurred. |
void onControl(boolean isConnected, RT_Message controlMsg)
RT_Consumer
when a control event has occurred.
To register this ControlHandler
for control notifications,
invoke the RT_Consumer.setControlHandler(com.factset.rt.ControlHandler)
method.
This method must not throw.
isConnected
- true
if the associated
RT_Consumer
instance is connected to a DataFeed server;
false
otherwisecontrolMsg
- a message that contains information about the control
event