blpapi.ServiceRegistrationOptions

class blpapi.ServiceRegistrationOptions

Contains the options which can be specified when registering a service.

To use non-default options to registerService(), create a ServiceRegistrationOptions instance and set the required options and then supply it when using the registerService() interface.

The following attributes represent service registration priorities:

The following attributes represent the registration parts:

PART_DEFAULT = 1

Register the parts of the service implied by options specified in the service metadata

PART_OPERATIONS = 4

Register to receive the request types corresponding to each “operation” defined in the service metadata

PART_PUBLISHER_RESOLUTION = 16

Register to receive resolution requests (with message type PermissionRequest) from publishers (via ProviderSession.createTopics())

PART_PUBLISHING = 2

Register to receive subscribe and unsubscribe messages

PART_SUBSCRIBER_RESOLUTION = 8

Register to receive resolution requests (with message type PermissionRequest) from subscribers

PRIORITY_HIGH = 2147483647
PRIORITY_LOW = 0
PRIORITY_MEDIUM = 1073741823
__init__()

Create ServiceRegistrationOptions with default options.

addActiveSubServiceCodeRange(begin, end, priority)
Parameters
  • begin (int) – Start of sub-service code range

  • end (int) – End of sub-service code range

  • priority (int) – Priority with which to receive subscriptions

Advertise the service to be registered to receive, with the specified priority, subscriptions that the resolver has mapped to a service code between the specified begin and the specified end values, inclusive. Numerically greater values of priority indicate higher priorities.

Note

The behavior of this function is undefined unless 0 <= begin <= end < (1 << 24), and priority is non-negative.

destroy()

Destroy this ServiceRegistrationOptions.

getGroupId()
Returns

The value of the service Group Id in this instance.

Return type

str

getPartsToRegister()
Returns

The parts of the service to be registered.

Return type

int

Registration parts are enumerated in the class docstring.

getServicePriority()
Returns

The value of the service priority in this instance.

Return type

int

removeAllActiveSubServiceCodeRanges()

Remove all previously added sub-service code ranges.

setGroupId(groupId)

Set the Group ID for the service to be registered.

Parameters

groupId (str) – The group ID for the service to be registered

Set the Group ID for the service to be registered to the specified groupId string. If groupId length is greater than MAX_GROUP_ID_SIZE (=64) only the first MAX_GROUP_ID_SIZE chars are considered as Group Id.

setPartsToRegister(parts)

Set the parts of the service to be registered.

Parameters

int – Parts of the service to be registered.

Set the parts of the service to be registered to the specified parts, which must be a bitwise-or of the options provided in “registration parts” options (enumerated in the class docstring). This option defaults to PART_DEFAULT.

setServicePriority(priority)

Set the priority with which a service will be registered.

Parameters

priority (int) – The service priority

Set the priority with which a service will be registered to the specified priority, where numerically greater values of priority indicate higher priorities. The behavior is undefined unless priority is non-negative. Note that while the values pre-defined in ServiceRegistrationOptions are suitable for use here, any non-negative priority is acceptable.

By default, a service will be registered with priority PRIORITY_HIGH.