public class RT_Consumer.BulkSubscription extends java.lang.Object implements RT_Consumer.Subscription
BulkSubscription
instances are obtained by casting a
RT_Consumer.Subscription
object, which is obtained by
invoking the RT_Consumer.request(com.factset.rt.RT_Request, com.factset.rt.MessageHandler)
method with a comma delimited
key. Each instance represents a unique bulk subscription message stream.
Each BulkSubscription
instance manages a list of
RT_Consumer.Subscription
instances, which can be obtained
by invoking the getSubscriptions()
methods.
BulkSubscription
instances should be treated as a system
resource. Applications are responsible for canceling each subscription
when it is no longer needed. This can be done by calling the
cancel()
method or by disconnect the associated consumer with the
RT_Consumer.disconnect()
methods. The API will never cancel a
subscription, even if the incoming messages' isClosed
or
isError
methods return true
.
Canceling BulkSubscription
instance cancels all
underlying RT_Consumer.Subscription
instance. The
individual RT_Consumer.Subscription
instance can also be
cancelled and removed from the subscription list by explicitly invoking
cancel()
method of itself.
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels all future incoming messages for this subscription.
|
RT_Message |
getCachedMsg()
Returns a
RT_Message representing the current cached values for
all known fields for this Subscription . |
java.lang.String |
getRequestedSymbol()
Returns a
String representing the requested symbol
associated with this MemberSubscription . |
java.util.List<RT_Consumer.Subscription> |
getSubscriptions()
Returns a list of
RT_Consumer.MemberSubscription instances this
BulkSubscription instance manages. |
boolean |
isCancelled()
Returns
true if this subscription has been cancelled. |
boolean |
isPending()
Returns
true if the request for this
Subscription has been internally queued and has yet to
be sent to the DataFeed server. |
java.lang.String |
toString() |
public java.util.List<RT_Consumer.Subscription> getSubscriptions()
RT_Consumer.MemberSubscription
instances this
BulkSubscription
instance manages.RT_Consumer.MemberSubscription
instances.public void cancel()
RT_Consumer.Subscription
MessageHandler
associated with this
subscription will no longer receive messages. This method can be
invoked at any time.
If this subscription is already cancelled, then invoking this method has no effect.
cancel
in interface RT_Consumer.Subscription
public boolean isPending()
RT_Consumer.Subscription
true
if the request for this
Subscription
has been internally queued and has yet to
be sent to the DataFeed server.
This can happen if RT_Consumer.request(com.factset.rt.RT_Request, com.factset.rt.MessageHandler)
is invoked without a
connection to a DataFeed server or if the requested service is not
currently available.
After the first message for this subscription arrives, this method
will always return false
.
isPending
in interface RT_Consumer.Subscription
true
if this Subscription
is
pending; false
otherwisepublic boolean isCancelled()
RT_Consumer.Subscription
true
if this subscription has been cancelled. A
subscription can only be cancelled by explicitly calling the
RT_Consumer.Subscription.cancel()
method.
If this subscription has been cancelled, the registered
MessageHandler
will no longer receive messages.
isCancelled
in interface RT_Consumer.Subscription
true
if this Subscription
has been
cancelled; false
otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRequestedSymbol()
RT_Consumer.Subscription
String
representing the requested symbol
associated with this MemberSubscription
.getRequestedSymbol
in interface RT_Consumer.Subscription
String
representing the requested symbol
associated with this MemberSubscription
.public RT_Message getCachedMsg()
RT_Consumer.Subscription
RT_Message
representing the current cached values for
all known fields for this Subscription
.getCachedMsg
in interface RT_Consumer.Subscription
RT_Message
representing the current cached values for
all known fields for this Subscription
.