blpapi.ResolutionList¶
-
class
blpapi.ResolutionList¶ Contains a list of topics that require resolution.
Created from topic strings or from
SUBSCRIPTION_STARTEDmessages. This is passed to aresolve()call orProviderSession.resolveAsync()call on aProviderSession. It is updated and returned by theresolve()call.The class attributes represent the states in which entries of a
ResolutionListcan be.-
RESOLUTION_FAILURE_BAD_SERVICE= 2¶
-
RESOLUTION_FAILURE_BAD_TOPIC= 4¶
-
RESOLUTION_FAILURE_SERVICE_AUTHORIZATION_FAILED= 3¶
-
RESOLUTION_FAILURE_TOPIC_AUTHORIZATION_FAILED= 5¶
-
RESOLVED= 1¶
-
UNRESOLVED= 0¶
-
__init__()¶ Create an empty
ResolutionList.
-
add(topicOrMessage, correlationId=None)¶ Add the specified topic or topic from message to this list.
- Parameters
correlationId (CorrelationId) – CorrelationId to associate with this operation
- Returns
0on success, negative number on failure- Return type
- Raises
TypeError – If
correlationIdis not an instance ofCorrelationId
If
topicOrMessageis of string type, add the specifiedtopicOrMessageto this list, optionally specifying acorrelationId. After a successful call toadd()the status for this entry isUNRESOLVED_TOPIC.If
topicOrMessageis ofMessagetype, add the topic contained in the specifiedtopicOrMessageto this list, optionally specifying acorrelationId. After a successful call toadd()the status for this entry isUNRESOLVED_TOPIC.
-
addAttribute(attribute)¶ Add the specified
attributeto the list of attributes.
-
attribute(attribute, correlationId)¶ - Parameters
attribute (str) – Attribute of the entry
correlationId (CorrelationId) – Correlation id identifying an entry in this list
- Returns
Value for the specified
attributeof this list entry.- Return type
- Raises
Exception – If
correlationIddoes not identify an entry in thisResolutionListor if the status of the entry identified bycorrelationIdis notRESOLVED.
The
Elementreturned may be empty if the resolution service cannot provide the attribute.
-
attributeAt(attribute, index)¶
-
correlationIdAt(index)¶ - Parameters
index (int) – Index of the correlation id
- Returns
CorrelationId at the specified
index.- Return type
- Raises
IndexOutOfRangeException – If
index >= size().
-
destroy()¶ Destroy resolutionlist
-
static
extractAttributeFromResolutionSuccess(message, attribute)¶ Return the value of the value in the specified
message.- Parameters
- Returns
Value of the value in the specified
messagewhich represents the specifiedattribute. If theattributeis not present an emptyElementis returned.- Return type
The
messagemust be a message of typeRESOLUTION_SUCCESS. Theattributeshould be an attribute that was requested usingaddAttribute()on theResolutionListpassed to theresolve()orresolveAsync()that caused thisRESOLUTION_SUCCESSmessage.
-
message(correlationId)¶ - Parameters
correlationId (CorrelationId) – Correlation id that identifies an entry in this list
- Returns
Message received during resolution of the topic identified by the specified
correlationId.- Return type
- Raises
Exception – If
correlationIddoes not identify an entry in thisResolutionListor if the status of the entry identify bycorrelationIdis notRESOLVEDan exception is raised.
-
messageAt(index)¶ - Parameters
index (int) – Index of an entry in this list
- Returns
Message received during resolution of the topic specified
indexth entry in thisResolutionList.- Return type
- Raises
Exception – If
index >= size()or if the status of theindexth entry is notRESOLVEDan exception is raised.
-
size()¶ - Returns
Number of entries in this
ResolutionList.- Return type
-
status(correlationId)¶ - Parameters
correlationId (CorrelationId) – Correlation id that identifies the entry
- Returns
status of the entry in this
ResolutionList.- Return type
- Raises
Exception – If the
correlationIddoes not identify an entry in thisResolutionList.
The possible statuses are represented by the class attributes of
ResolutionList.
-
statusAt(index)¶ - Parameters
correlationId (CorrelationId) – Correlation id that identifies the entry
- Returns
status of the entry in this
ResolutionList.- Return type
- Raises
IndexOutOfRangeException – If
index >= size().
The possible statuses are represented by the class attributes of
ResolutionList.
-
topicString(correlationId)¶ Return the topic of the entry identified by
correlationId.- Parameters
correlationId (CorrelationId) – Correlation id that identifies the topic
- Returns
Topic string of the entry identified by
correlationId.- Return type
- Raises
Exception – If
correlationIddoes not identify an entry in thisResolutionList.
-
topicStringAt(index)¶ - Parameters
index (int) – Index of the topic string
- Returns
Topic string at the specified
index.- Return type
- Raises
IndexOutOfRangeException – If
index >= size().
-