Click or drag to resize
IAbstractSession Interface
An abstract session for sharing methods between ISessionand IProviderSession.

Sessions manage access to services either by requests and responses or subscriptions. A session can dispatch events and replies in either a synchronous or asynchronous mode. The mode of a session is determined when it is constructed and cannot be changed subsequently.

A session must be started with Start or StartAsync before calling on any of its operations.

Namespace:  Bloomberglp.Blpapi
Assembly:  Bloomberglp.Blpapi (in Bloomberglp.Blpapi.dll) Version: 3.24.10.1
Syntax
public interface IAbstractSession : IDisposable

The IAbstractSession type exposes the following members.

Methods
  NameDescription
Public methodCancel(CorrelationID)
Cancels an outstanding request or a subscription.
Public methodCancel(IListCorrelationID)
This is the same as calling Cancel(CorrelationID, String) with a null request label.
Public methodCancel(CorrelationID, String)
Cancels an outstanding request or a subscription.
Public methodCancel(IListCorrelationID, String)
Cancels outstanding requests or subscriptions.

Cancels a previous request or subscription for asynchronous topic updates associated with each CorrelationID in correlators. Upon return, no further message will be generated for those requests or subscriptions.

For asynchronous sessions, a handler may still be processing an existing message for the associated request or subscription after the call returns. While iterating over an event, if any message is encountered for a cancelled CorrelationID, it will be silently ignored, but if the message was iterated to just prior to the completion of the cancel request it will be delivered, it is up to the application developer to handle this condition.

If any of the specified CorrelationIds do not refer to an "active" request or Subscription then, that particular CorrelationID will be ignored.

Once this call returns, the specified CorrelationID can be reused for new requests to this session. Also note that application developers should generally be cautious not to reuse a CorrelationID until all existing references within their applications have been cleared. Depending on the use of the CorrelationID, this can possibly result in accessing application resources which are no longer available.

Public methodCreateIdentity
Creates a new Identity which is valid but has not been authorized.

Create a handle to represent a user of services. For using services with the specific user's credentials the identity should be authorized with the corresponding authorization service.

Public methodGenerateAuthorizedIdentity
Generates an authorized Identity with the specified authOptions and cid.

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.

Public methodGenerateToken
This is the same as calling GenerateToken(String, String, CorrelationID, IEventQueue) with all null arguments.
Public methodGenerateToken(CorrelationID)
This is the same as calling GenerateToken(String, String, CorrelationID, IEventQueue) with a null user ID and IP address and a null IEventQueue.
Public methodGenerateToken(CorrelationID, IEventQueue)
This is the same as calling GenerateToken(String, String, CorrelationID, IEventQueue) with a null user ID and IP address.
Public methodGenerateToken(String, String, CorrelationID, IEventQueue)
Generate a token to be used for authorization.

Valid authentication options must have been specified in the SessionOptions.

Public methodGetAuthorizedIdentity
Gets an authorized Identity. A CorrelationID that maps to an authorized Identity.

If cid is omitted and the session identity is authorized, the function will return the session identity.

An authorized identity must be mapped to cid. If cid is omitted the session identity must have been authorized.

Public methodGetService
Gets the Service object.
Public methodNextEvent
This is the same as NextEvent(Int64) with 0 milliseconds.
Public methodNextEvent(Int64)
Returns the next event available for processing on this session.

If no event is available immediately wait for timeoutMillis milliseconds for an event to arrive. If no event is received before the timeout expires return a TIMEOUT event. If the timeout specified is 0 then wait for an infinite amount of time for an event to be received. Note that this function cannot be called on a session that is operating in "asynchronous" mode. That is a session that was constructed with an EventHandler.

An EventHandler must not have been provided at construction.
Public methodOpenService
Opens the service.
Public methodOpenServiceAsync(String)
Issues an asynchronous request to open a service.
Public methodOpenServiceAsync(String, CorrelationID)
Initiates an asynchronous request to open a service.

Once the request has completed, a SERVICE_STATUS event will be generated indicating the result of the request. The correlationId will be returned in generated message. It can also be used to cancel this request before it completes by calling Cancel(CorrelationID).

Public methodSendAuthorizationRequest(Request, Identity, CorrelationID)
This is the same as calling SendAuthorizationRequest(Request, Identity, IEventQueue, CorrelationID, String) with a null IEventQueue and null request label.
Public methodSendAuthorizationRequest(Request, Identity, CorrelationID, String)
Public methodSendAuthorizationRequest(Request, Identity, IEventQueue, CorrelationID)
This is the same as calling SendAuthorizationRequest(Request, Identity, IEventQueue, CorrelationID, String) with a null request label.
Public methodSendAuthorizationRequest(Request, Identity, IEventQueue, CorrelationID, String)
Authorizes an identity.

This request can be used by applications to authorize users to receive data from services. If a user is successfully authorized all the entitlements for that user are cached locally. Once authorized the identity can be used to make subscriptions and requests as the user.

If an IEventQueue is specified then all response events for this Authorization Request are published to this event queue. The user can block on this event queue for responses and can use this as a mechanism to convert this asynchronous request into a synchronous request.

An Event will be published containing a message with the result of the authorization request. If the user was successfully authorized an "AuthorizationSuccess" message will be generated. If the user was not authorized an "AuthorizationFailure" message will be generated.

Public methodStart
Issues a blocking call to start the session.

A SESSION_STATUS event may be published containing a message with the result of the request. If the session was started successfully a "SessionStarted" message will be generated. If the start failed a "SessionStartupFailure" message may be generated.

Note: If this is an asynchronous session then the SESSION_STATUS event may be processed by the registered EventHandler before this method has returned. If this session is using an external EventDispatcher it should be already started.

A session must only be started once.

Public methodStartAsync
Initiates a non blocking call to start the session.

On completion of this request a SESSION_STATUS event is published containing a message with the result of the request. If the session was started successfully a "SessionStarted" message will be generated. If the start failed a "SessionStartupFailure" message will be generated.

Note: If this is an asynchronous session then the SESSION_STATUS may be processed by the registered EventHandler before this method has returned. If this session is using an external EventDispatcher it should be already started.

A session must only be started once.

Public methodStop
Public methodStop(AbstractSessionStopOption)
Stops this session.
Public methodTryNextEvent
Retrieves the next event available for processing on this session.

This method never blocks.

An EventHandler must not have been provided at construction.
Top
See Also