Bloomberg API for .NET
ProviderSession Class
NamespacesBloomberglp.BlpapiProviderSession
This class provides a session that can be used for providing services.
Declaration Syntax
C#Visual BasicVisual C++
public sealed class ProviderSession : AbstractSession
Public NotInheritable Class ProviderSession
	Inherits AbstractSession
public ref class ProviderSession sealed : public AbstractSession
Members
All MembersConstructorsMethods



IconMemberDescription
ProviderSession()()()()
Initializes a new instance of the ProviderSession class

ProviderSession(SessionOptions)
Initializes a new instance of the ProviderSession class

ProviderSession(SessionOptions, ProviderEventHandler)
Initializes a new instance of the ProviderSession class

ProviderSession(SessionOptions, ProviderEventHandler, EventDispatcher)
Constructs a Session using the optionally specified 'options', the optionally specified 'eventHandler' and the optionally specified 'eventDispatcher'.

See the SessionOptions documentation for details on what can be specified in the 'options'.

If 'eventHandler' is not null then this Session will operation in asynchronous mode, otherwise the Session will operate in synchronous mode.

If 'eventDispatcher' is null then the Session will create a default EventDispatcher for this Session which will use a single thread for dispatching events. For more control over event dispatching a specific instance of EventDispatcher can be supplied. This can be used to share a single EventDispatcher amongst multiple Session objects.

If an 'eventDispatcher' is supplied which uses more than one thread the Session will ensure that events which should be ordered are passed to callbacks in a correct order. For example, partial response to a request or updates to a single subscription. If 'eventHandler' is null and the 'eventDispatcher' is not null an exception is thrown. Each EventDispatcher uses its own thread or pool of threads so if you want to ensure that a session which receives very large messages and takes a long time to process them does not delay a session that receives small messages and processes each one very quickly then give each one a separate EventDispatcher.


ActivateSubServiceCodeRange(String, Int32, Int32, Int32)
Activates sub-service code range of the specified ['begin', 'end'] and the specified 'priority' to an already registered service. The behavior is undefined unless 'begin', 'end' and 'priority' are between 0 and 2^24 (2 to the power of 24) and the service has already been registered.

Cancel(CorrelationID)
Cancels an outstanding request or a subscription represented by the specified correlationId.
(Inherited from AbstractSession.)
Cancel(CorrelationID, String)
Cancels an outstanding request or a subscription represented by the specified correlationId.
(Inherited from AbstractSession.)
Cancel(IList<(Of <<'(CorrelationID>)>>))
Cancels outstanding requests or subscriptions represented by the specified list of correlationIds.
(Inherited from AbstractSession.)
Cancel(IList<(Of <<'(CorrelationID>)>>), String)
Cancels outstanding requests or subscriptions represented by the specified list of correlationIds.
(Inherited from AbstractSession.)
CreateIdentity()()()()
Returns a new Identity which is valid but has not been authorized.
(Inherited from AbstractSession.)
CreateTopic(Message) Obsolete.
Creates a new Topic object based on the specified 'message'. The 'message' must be one of the following types: SUBSCRIPTION_STARTED, SUBSCRIPTION_STOPPED, RECAP or RESOLUTION_SUCCESS. If the 'message' is not valid then invoking isValid() on the returned Topic will return false.

CreateTopics(TopicList)
Creates the topics in the specified 'topicList' and updates the 'topicList' with the results of the resolution and creation process.

CreateTopics(TopicList, ResolveMode)
Creates the topics in the specified 'topicList' and updates the 'topicList' with the results of the resolution and creation process.

CreateTopics(TopicList, ResolveMode, Identity)
Creates the topics in the specified 'topicList' and updates the 'topicList' with the results of the resolution and creation process.

CreateTopicsAsync(TopicList)
Begins the creation of the topics in the specified 'topicList'.

CreateTopicsAsync(TopicList, ResolveMode)
Begins the creation of the topics in the specified 'topicList'.

CreateTopicsAsync(TopicList, ResolveMode, Identity)
Begins the creation of the topics in the specified 'topicList'.

CreateUserHandle()()()() Obsolete. (Inherited from AbstractSession.)
DeactivateSubServiceCodeRange(String, Int32, Int32)
De-activates sub-service code range specified by [begin, end] from to an already registered service. The behavior is undefined unless 'begin' and 'end' are between 0 and 2^24 (2 to the power of 24) and the service has already been registered.

DeleteTopic(Topic)
Removes one reference from the specified 'topic'.

DeleteTopics(IEnumerable<(Of <<'(Topic>)>>))
Deletes each topic in the specified 'topics'.

DeregisterService(String)
Deregisters the service identified by the specified 'uri'.

IDisposable..::..Dispose()()()()
Dispose this Session object. It calls AbstractSession.Stop() to close the opened socket.
(Inherited from AbstractSession.)
GenerateToken(CorrelationID, EventQueue)
Return a generated token to be used for authorization.
(Inherited from AbstractSession.)
GenerateToken(CorrelationID)
Return a generated token to be used for authorization.
(Inherited from AbstractSession.)
GenerateToken()()()()
Return a generated token to be used for authorization.
(Inherited from AbstractSession.)
GetService(String)
Returns a handle to a Service object representing the service identified by the specified uri.
(Inherited from AbstractSession.)
GetTopic(Message)
Finds a previously created Topic object based on the specified
 Copy imageCopy
message

NextEvent()()()()
Returns the next event available for processing on this session.
(Inherited from AbstractSession.)
NextEvent(Int64)
Returns the next event available for processing on this session.
(Inherited from AbstractSession.)
OpenService(String)
Opens the service having the specified uri.
(Inherited from AbstractSession.)
OpenServiceAsync(String)
Issues an asynchronous request to open a service.
(Inherited from AbstractSession.)
OpenServiceAsync(String, CorrelationID)
Initiates an asynchronous request to open a service.
(Inherited from AbstractSession.)
Publish(Event)
Publish the specified 'event'.

RegisterService(String, Identity)

Attempts to register the service identified by the specified 'uri' and blocks until the service is either registered successfully or has failed to be registered. The specified 'providerIdentity' is used to verify permissions to provide the service being registered. Returns true if the service is registered successfully and false if the service cannot be registered successfully.

The 'uri' must begin with a full qualified service name. That is it must begin with "//{namespace}/{service-name}[/]". Any portion of the 'uri' after the service name is ignored.

This method does not return until a SERVICE_STATUS event has been generated. Note that if the session was created in asynchronous mode, the event may be processed before the function returns.


RegisterService(String, Identity, ServiceRegistrationOptions)

Attempts to register the service identified by the specified 'uri' and blocks until the service is either registered successfully or has failed to be registered. The specified 'providerIdentity' is used to verify permissions to provide the service being registered. Returns true if the service is registered successfully and false if the service cannot be registered successfully.

The 'uri' must begin with a full qualified service name. That is it must begin with "//{namespace}/{service-name}[/]". Any portion of the 'uri' after the service name is ignored.

This method does not return until a SERVICE_STATUS event has been generated. Note that if the session was created in asynchronous mode, the event may be processed before the function returns.


RegisterServiceAsync(String, Identity)
Begins the process of registering the service identified by the specified 'uri' with identity and returns immediately.

RegisterServiceAsync(String, Identity, ServiceRegistrationOptions)
Begins the process of registering the service identified by the specified 'uri' with identity and registration options, and returns immediately.

RegisterServiceAsync(String, Identity, CorrelationID)
Begins the process of registering the service identified by the specified 'uri' and returns immediately.

RegisterServiceAsync(String, Identity, CorrelationID, ServiceRegistrationOptions)
Begins the process of registering the service identified by the specified 'uri' with identity, CorrelationID and registration options. Returns immediately.

Resolve(ResolutionList)
Resolves the topics in the specified 'resolutionList' and updates the 'resolutionList' with the results of the resolution process. All services referenced in the topics in the 'resolutionList' must already have been registered using registerService(). Once resolve() returns each entry in the 'resolutionList' will have been updated with a new status.

Resolve(ResolutionList, ResolveMode)
Resolves the topics in the specified 'resolutionList' and updates the 'resolutionList' with the results of the resolution process.

Resolve(ResolutionList, ResolveMode, Identity)
Resolves the topics in the specified 'resolutionList' and updates the 'resolutionList' with the results of the resolution process.

ResolveAsync(ResolutionList)
Begins the resolution of the topics in the specified 'resolutionList'.

ResolveAsync(ResolutionList, ResolveMode)
Begins the resolution of the topics in the specified 'resolutionList'.

ResolveAsync(ResolutionList, ResolveMode, Identity)
Begins the resolution of the topics in the specified 'resolutionList'.

SendAuthorizationRequest(Request, Identity, CorrelationID)
Sends the specified authorizationRequest and update the specified identity with the results.
(Inherited from AbstractSession.)
SendAuthorizationRequest(Request, UserHandle, CorrelationID) Obsolete. (Inherited from AbstractSession.)
SendAuthorizationRequest(Request, Identity, CorrelationID, String)
Sends the specified authorizationRequest and update the specified identity with the results.
(Inherited from AbstractSession.)
SendAuthorizationRequest(Request, UserHandle, CorrelationID, String) Obsolete. (Inherited from AbstractSession.)
SendAuthorizationRequest(Request, Identity, EventQueue, CorrelationID)
Sends the specified authorizationRequest and update the specified identity with the results.
(Inherited from AbstractSession.)
SendAuthorizationRequest(Request, UserHandle, EventQueue, CorrelationID) Obsolete. (Inherited from AbstractSession.)
SendAuthorizationRequest(Request, Identity, EventQueue, CorrelationID, String)
Sends the specified authorizationRequest and update the specified identity with the results.
(Inherited from AbstractSession.)
SendAuthorizationRequest(Request, UserHandle, EventQueue, CorrelationID, String) Obsolete. (Inherited from AbstractSession.)
SendResponse(Event)
Sends the response event for previously received request

SendResponse(Event, Boolean)
Sends the response event for previously received request

SetEventHandler(ProviderEventHandler, Event..::..EventType)
Sets event specific event handlers

Start()()()()
Issues a blocking call to start the session.
(Inherited from AbstractSession.)
StartAsync()()()()
Initiates a non blocking call to start the session.
(Inherited from AbstractSession.)
Stop()()()()
Stops this session.
(Inherited from AbstractSession.)
Stop(AbstractSession..::..StopOption)
Stops the operation of this session.
(Inherited from AbstractSession.)
TryNextEvent()()()()
Tries to retrieve the next event available for processing on this session
(Inherited from AbstractSession.)
Remarks

ProviderSession inherits from AbstractSession. In addition to the AbstractSession functionality, a ProviderSession provides the following functions to applications.

Applications can register to provide Services using either ProviderSession.RegisterService() or ProviderSession.RegisterServiceAsync(). Before registering to provide a Service an application must have established its identity.

After applications have registered a service they will start receiving subscription requests ('TopicSubscribed' message in EventType.TOPIC_STATUS) for topics which belong to the service. If the resolver has specified 'subServiceCode' for topics in 'PermissionResponse', then only providers who have activated the 'subServiceCode' will get the subscription request. Where multiple providers have registered the same service and sub-service code (if any), the provider that registered the highest priority for the sub-service code will receive subscription requests; if multiple providers have registered the same sub-service code with the same priority (or the resolver did not set a sub-service code for the subscription), the subscription request will be routed to one of the providers with the highest service priority.

Topic Life Cycle

A provider wishing to publish subscription data must explicitly open each topic on which they publish using ProviderSession.CreateTopics (or ProviderSession.CreateTopicsAsync). Creating a topic prepares the distribution and caching infrastructure for new data associated with the topic's resolved identifier. (Note that several different topics could resolve to the same ID.) Independent of a topic's creation status is its subscription status, i.e. whether there are subscribers ready to receive the data published. A topic that is both created and subscribed is *activated*.

There are two models for managing topic creation: broadcast and interactive. Broadcast publishers proactively call ProviderSession.CreateTopics for each topic on which they intend to publish, while interactive publishers wait to receive a 'TopicSubscribed' message (within an Event of type Event.EventType.TOPIC_STATUS before calling ProviderSession.CreateTopics in response. Topics are resolved before they are created---it is possible that multiple different topic strings will map to the same underlying topic. See below for the behavior of the SDK when the same topic is created multiple times.

After ProviderSession.CreateTopics is called, the publisher will receive a 'TopicCreated' message (within a Event.EventType.TOPIC_STATUS event), and when there is at least one subscriber to the topic the publisher will then receive a 'TopicActivated' message (also within an Event.EventType.TOPIC_STATUS event). As subscribers come and go, additional 'TopicSubscribed', 'TopicActivated', 'TopicUnsubscribed', and 'TopicDeactivated' messages may be received by the publisher. A Topic object can be retrieved from each of these messages using the ProviderSession.GetTopic method, and this object can be used for subsequent calls to EventFormatter.AppendMessage and ProviderSession.DeleteTopic. In the case that the same resolved topic is created multiple times by a publisher using different names, it is unspecified which of those names will be returned by Message.TopicName for these (or other) messages.

If a publisher no longer intends to publish data on a topic, it can call ProviderSession.DeleteTopic to free the internal caching and distribution resources associated with the topic. When a resolved topic has been deleted the same number of times that it has been created, a 'TopicDeleted' message will be delivered, preceded by 'TopicUnsubscribed' and 'TopicDeactivated' messages if the topic was still subscribed (and activated). No further messages can be published on a deleted topic.

Deregistering a service deletes all topics associated with that service.

Note that 'TopicActivated' and 'TopicDeactivated' messages are entirely redundant with 'TopicCreated', 'TopicSubscribed', 'TopicDeleted', and 'TopicUnsubscribed' messages, and are provided only for the convenience of publishers that do not maintain per-topic state.

Inheritance Hierarchy
Object
AbstractSession
 ProviderSession

Assembly: Bloomberglp.Blpapi (Module: Bloomberglp.Blpapi.dll) Version: 3.7.4.1