ProviderSession Class |
Namespace: Bloomberglp.Blpapi
The ProviderSession type exposes the following members.
Name | Description | |
---|---|---|
ProviderSession | Construct provider session with no options,
event handler or event dispatcher.
ProviderSession(SessionOptions, ProviderEventHandler, EventDispatcher) | |
ProviderSession(SessionOptions) | The constructor with SessionOptions
| |
ProviderSession(SessionOptions, ProviderEventHandler) | The constructor with SessionOptions and ProviderEventHandler
| |
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. |
Name | Description | |
---|---|---|
ActivateSubServiceCodeRange |
Activates sub-service code range of the specified
[begin, end]
and the specified priority to an already
registered service.
Numerically greater values of priority indicate higher priorities.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(IListCorrelationID) | Cancels outstanding requests or subscriptions represented by the
specified list of correlationIds.
(Inherited from AbstractSession.) | |
Cancel(CorrelationID, String) | Cancels an outstanding request or a subscription represented by the
specified correlationId.
(Inherited from AbstractSession.) | |
Cancel(IListCorrelationID, 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 | 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(ITopicList) |
Creates the topics in the specified 'topicList' and updates the
'topicList' with the results of the resolution and creation process.
The session identity will be used if it's been authorized. | |
CreateTopics(ITopicList, ResolveMode) |
Creates the topics in the specified 'topicList' and updates the
'topicList' with the results of the resolution and creation process.
The session identity will be used if it's been authorized. | |
CreateTopics(ITopicList, ResolveMode, Identity) | Creates the topics in the specified 'topicList' and updates the
'topicList' with the results of the resolution and creation process.
| |
CreateTopicsAsync(ITopicList) |
Begins the creation of the topics in the specified 'topicList'.
The session identity will be used if it's been authorized. | |
CreateTopicsAsync(ITopicList, ResolveMode) |
Begins the creation of the topics in the specified 'topicList'.
The session identity will be used if it's been authorized. | |
CreateTopicsAsync(ITopicList, ResolveMode, Identity) | Begins the creation of the topics in the specified 'topicList'.
| |
CreateUserHandle | Obsolete. Deprecated since 3.3.0.0. Use CreateIdentity instead.
(Inherited from AbstractSession.) | |
DeactivateSubServiceCodeRange |
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 |
Removes one reference from the specified 'topic'.
| |
DeleteTopics |
Deletes each topic in the specified 'topics'.
| |
DeregisterService |
Deregisters the service identified by the specified 'uri'.
| |
GenerateAuthorizedIdentity |
Generates an authorized Identity with the specified
authOptions and cid.
(Inherited from AbstractSession.)One or more AUTHORIZATION_STATUS events, zero or more TOKEN_STATUS events and zero or more SERVICE_STATUS events are generated. If this is an asynchronous AbstractSession then an Event may be processed by the registered EventHandler before GenerateAuthorizedIdentity(AuthOptions, CorrelationID) has returned. The behavior is undefined when authOptions is null. | |
GenerateToken | 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(CorrelationID, IEventQueue) | Return a generated token to be used for authorization.
(Inherited from AbstractSession.) | |
GenerateToken(String, String, CorrelationID, IEventQueue) |
Return a generated token to be used for authorization.
(Inherited from AbstractSession.) | |
GetAuthorizedIdentity |
Gets the authorized Identity associated with the
specified cid.
(Inherited from AbstractSession.)If cid is omitted and the session identity is authorized, the function will return the session identity. | |
GetService |
Returns a handle to a
Service
object representing the service
identified by the specified uri.
(Inherited from AbstractSession.) | |
GetTopic | ||
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 |
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 |
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. When providerIdentity is null the session identity will be used if it's been authorized. | |
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. When providerIdentity is null the session identity will be used if it's been authorized. | |
RegisterServiceAsync(String, Identity) |
Begins the process of registering the service identified by the
specified 'uri' with identity and returns immediately.
| |
RegisterServiceAsync(String, Identity, CorrelationID) |
Begins the process of registering the service identified by the
specified 'uri' and returns immediately.
When providerIdentity is null the session identity will be used if it's been authorized. | |
RegisterServiceAsync(String, Identity, ServiceRegistrationOptions) |
Begins the process of registering the service identified by the
specified 'uri' with identity and registration options, and returns
immediately.
When providerIdentity is null the session identity will be used if it's been authorized. | |
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.
When providerIdentity is null the session identity will be used if it's been authorized. | |
Resolve(IResolutionList) |
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.
The session identity will be used if it's been authorized. | |
Resolve(IResolutionList, ResolveMode) |
Resolves the topics in the specified 'resolutionList' and updates the
'resolutionList' with the results of the resolution process.
The session identity will be used if it's been authorized. | |
Resolve(IResolutionList, ResolveMode, Identity) |
Resolves the topics in the specified 'resolutionList' and updates the
'resolutionList' with the results of the resolution process.
| |
ResolveAsync(IResolutionList) |
Begins the resolution of the topics in the specified 'resolutionList'.
The session identity will be used if it's been authorized. | |
ResolveAsync(IResolutionList, ResolveMode) |
Begins the resolution of the topics in the specified 'resolutionList'.
The session identity will be used if it's been authorized. | |
ResolveAsync(IResolutionList, 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. Deprecated since 3.3.0.0. Use
SendAuthorizationRequest(Request, Identity, CorrelationID)instead.
(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, Identity, IEventQueue, CorrelationID) | Sends the specified authorizationRequest and update the specified
identity with the results.
(Inherited from AbstractSession.) | |
SendAuthorizationRequest(Request, UserHandle, CorrelationID, String) | Obsolete. Deprecated since 3.3.0.0. Use
SendAuthorizationRequest(Request, Identity, CorrelationID, String) instead.
(Inherited from AbstractSession.) | |
SendAuthorizationRequest(Request, UserHandle, IEventQueue, CorrelationID) | Obsolete. Deprecated since 3.3.0.0. Use
SendAuthorizationRequest(Request, Identity, IEventQueue, CorrelationID) instead.
(Inherited from AbstractSession.) | |
SendAuthorizationRequest(Request, Identity, IEventQueue, CorrelationID, String) | Sends the specified authorizationRequest and update the specified
identity with the results.
(Inherited from AbstractSession.) | |
SendAuthorizationRequest(Request, UserHandle, IEventQueue, CorrelationID, String) | Obsolete. Deprecated since 3.3.0.0. Use
SendAuthorizationRequest(Request, UserHandle, IEventQueue, CorrelationID, String) instead.
(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 | 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(AbstractSessionStopOption) | 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.) |
Name | Description | |
---|---|---|
IDisposableDispose |
Dispose this Session object. It calls AbstractSession.Stop() to
close the opened socket.
(Inherited from AbstractSession.) |
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 CycleA 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 '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.