public class RT_Message extends java.lang.Object implements java.lang.Iterable<RT_FidField>
RT_Consumer
.
RT_Message
instances are obtained from an invocation of the
MessageHandler.onMessage(com.factset.rt.RT_Consumer.Subscription, com.factset.rt.RT_Message)
method. These messages contain real-time
data associated with a subscription.
Modifier and Type | Method and Description |
---|---|
int |
count()
Returns the number of fields contained in this message.
|
boolean |
erase(int fid)
Erase the fid from the Message
|
boolean |
exists(int fid)
Returns
true if the field indicated by the given field
identifier is contained in this message. |
short |
getError()
Returns the error code reported in this message.
|
java.lang.String |
getErrorDescription()
Returns a description of the error reported in this message.
|
java.lang.String |
getField(int fid)
Returns a string containing the value associated with the given field
identifier.
|
RT_FidField |
getFieldByIndex(int index)
Returns an
RT_FidField containing the FID/value pair at the
given zero-based index. |
java.lang.String |
getKey()
Returns a key that identifies the source of this message.
|
java.lang.String |
getPermissions()
Returns the permissions for this message.
|
java.lang.String |
getStaleReason()
Returns an explanation of the stale state of this message.
|
boolean |
isAggregated()
Returns
true if this message has been combined with similar
updates to reduce bandwidth requirements. |
boolean |
isClosed()
Returns
true if the associated subscription stream has been
closed by the DataFeed server. |
boolean |
isComplete()
Returns
true if this message the last message in a multiple
message initial response. |
boolean |
isError()
Returns
true if this message is reporting an error from the
DataFeed server. |
boolean |
isPermissioned()
Returns
true if this message contains permission
information. |
boolean |
isResponse()
Returns
true if this is the first message received for the
associated subscription. |
boolean |
isStale()
Returns
true if the associated subscription has become
stale. |
boolean |
isUpdate()
Returns
true if this is not the first message received for
the associated subscription. |
java.util.Iterator<RT_FidField> |
iterator()
Returns an iterator over the FID/value pairs containged in this message
in proper sequence.
|
void |
setField(int fid,
java.lang.String value)
Sets the given field to the given value.
|
java.lang.String |
toString()
Returns a brief description of this message.
|
public java.lang.String getKey()
A key is typically the symbol of the requested security.
public java.lang.String getPermissions()
public java.lang.String getStaleReason()
This method will return an empty string if the isStale()
method
returns false
.
public java.lang.String getErrorDescription()
This method will return an empty string if the isError()
method
returns false
.
public short getError()
RT_Error
public boolean isResponse()
true
if this is the first message received for the
associated subscription.true
if this is the initial response;
false
otherwisepublic boolean isUpdate()
true
if this is not the first message received for
the associated subscription.true
if this is an update to a previous response;
false
otherwisepublic boolean isComplete()
true
if this message the last message in a multiple
message initial response.true
if this message completes the initial
response; false
otherwisepublic boolean isClosed()
true
if the associated subscription stream has been
closed by the DataFeed server.
If this method returns true
, applications must still cancel
the associated subscription to free the resource.
true
if the associated stream has been closed;
false
otherwisepublic boolean isPermissioned()
true
if this message contains permission
information.true
if this message contains permission
information; false
otherwisepublic boolean isError()
true
if this message is reporting an error from the
DataFeed server.true
if this is an error message;
false
otherwisepublic boolean isStale()
true
if the associated subscription has become
stale.true
if this is a stale message; false
otherwisepublic boolean isAggregated()
true
if this message has been combined with similar
updates to reduce bandwidth requirements.true
if this message has been aggregated;
false
otherwisepublic void setField(int fid, java.lang.String value)
fid
- a field identifiervalue
- a string containing a field valuepublic boolean erase(int fid)
fid
- a field identifierpublic java.lang.String getField(int fid)
If this message does not contain the specified field, an empty string will be returned.
fid
- a field identifierpublic RT_FidField getFieldByIndex(int index)
RT_FidField
containing the FID/value pair at the
given zero-based index.index
- a field indexjava.lang.IndexOutOfBoundsException
- if index
is not a valid
index to this messagepublic boolean exists(int fid)
true
if the field indicated by the given field
identifier is contained in this message.fid
- a field identifiertrue
if the field identifier exists;
false
otherwisepublic int count()
public java.util.Iterator<RT_FidField> iterator()
RT_FidField
.iterator
in interface java.lang.Iterable<RT_FidField>
public java.lang.String toString()
toString
in class java.lang.Object