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.

Return type:

None

Note

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

destroy()

Destroy the handle using stored dtor

Return type:

None

getGroupId()
Return type:

str

Returns:

The value of the service Group Id in this instance.

getPartsToRegister()
Return type:

int

Returns:

The parts of the service to be registered.

Registration parts are enumerated in the class docstring.

getServicePriority()
Return type:

int

Returns:

The value of the priority for subscription services in this instance.

removeAllActiveSubServiceCodeRanges()

Remove all previously added sub-service code ranges.

Return type:

None

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.

Return type:

None

setPartsToRegister(parts)

Set the parts of the service to be registered.

Parameters:

parts (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.

Return type:

None

setServicePriority(priority)

Set the priority with which a subscription service will be registered.

Parameters:

priority (int) – The service priority

Set the priority with which a subscription 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.

Note this has no effect for resolution services.

Return type:

int