blpapi.ResolutionList

class blpapi.ResolutionList

Contains a list of topics that require resolution.

Created from topic strings or from SUBSCRIPTION_STARTED messages. This is passed to a resolve() call or ProviderSession.resolveAsync() call on a ProviderSession. It is updated and returned by the resolve() call.

The class attributes represent the states in which entries of a ResolutionList can 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
  • topicOrMessage (str or Message) – Topic or message to add

  • correlationId (CorrelationId) – CorrelationId to associate with this operation

Returns

0 on success, negative number on failure

Return type

int

Raises

TypeError – If correlationId is not an instance of CorrelationId

If topicOrMessage is of string type, add the specified topicOrMessage to this list, optionally specifying a correlationId. After a successful call to add() the status for this entry is UNRESOLVED_TOPIC.

If topicOrMessage is of Message type, add the topic contained in the specified topicOrMessage to this list, optionally specifying a correlationId. After a successful call to add() the status for this entry is UNRESOLVED_TOPIC.

addAttribute(attribute)

Add the specified attribute to the list of attributes.

Parameters

attribute (str) – Attribute to add

Returns

0 on success, negative number on failure.

Return type

int

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 attribute of this list entry.

Return type

Element

Raises

Exception – If correlationId does not identify an entry in this ResolutionList or if the status of the entry identified by correlationId is not RESOLVED.

The Element returned may be empty if the resolution service cannot provide the attribute.

attributeAt(attribute, index)
Parameters
  • attribute (str) – Attribute of the entry

  • index (int) – Index of the entry

Returns

Value for the specified attribute of this list entry.

Return type

Element

Raises

Exception – If index >= size() or if the status of the indexth entry identified by correlationId is not RESOLVED.

correlationIdAt(index)
Parameters

index (int) – Index of the correlation id

Returns

CorrelationId at the specified index.

Return type

CorrelationId

Raises

IndexOutOfRangeException – If index >= size().

destroy()

Destroy resolutionlist

static extractAttributeFromResolutionSuccess(message, attribute)

Return the value of the value in the specified message.

Parameters
  • message (Message) – Message to extract the attribute from

  • attribute (Name) – Attribute to extract

Returns

Value of the value in the specified message which represents the specified attribute. If the attribute is not present an empty Element is returned.

Return type

Element

The message must be a message of type RESOLUTION_SUCCESS. The attribute should be an attribute that was requested using addAttribute() on the ResolutionList passed to the resolve() or resolveAsync() that caused this RESOLUTION_SUCCESS message.

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

Message

Raises

Exception – If correlationId does not identify an entry in this ResolutionList or if the status of the entry identify by correlationId is not RESOLVED an exception is raised.

Note

The Message returned can be used when creating an instance of Topic.

messageAt(index)
Parameters

index (int) – Index of an entry in this list

Returns

Message received during resolution of the topic specified indexth entry in this ResolutionList.

Return type

Message

Raises

Exception – If index >= size() or if the status of the indexth entry is not RESOLVED an exception is raised.

Note

The Message returned can be used when creating an instance of Topic.

size()
Returns

Number of entries in this ResolutionList.

Return type

int

status(correlationId)
Parameters

correlationId (CorrelationId) – Correlation id that identifies the entry

Returns

status of the entry in this ResolutionList.

Return type

int

Raises

Exception – If the correlationId does not identify an entry in this ResolutionList.

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

int

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

str

Raises

Exception – If correlationId does not identify an entry in this ResolutionList.

topicStringAt(index)
Parameters

index (int) – Index of the topic string

Returns

Topic string at the specified index.

Return type

str

Raises

IndexOutOfRangeException – If index >= size().