Namespace Lightstreamer.Interfaces.Data
Classes
DataException
Base class for all exceptions directly thrown by the Data Adapter.
DataProviderConstants
Contains constants for the special field names and field values recognized by the Server.
DataProviderException
Thrown by the init method in DataProvider if there is some problem that prevents the correct behavior of the Data Adapter. If this exception occurs, Lightstreamer Kernel must give up the startup.
FailureException
Thrown by the subscribe and unsubscribe methods in DataProvider if the method execution has caused a severe problem that can compromise future operation of the Data Adapter.
SubscriptionException
Thrown by the subscribe and unsubscribe methods in DataProvider if the request cannot be satisfied.
Interfaces
IDataProvider
Provides an interface to be implemented by a Remote Data Adapter in order to attach a Data Provider to Lightstreamer. A single instance of a Remote Data Adapter is created by Lightstreamer through the launch of a Remote Server, based on configured class name and parameters. For this purpose, any Remote Data Adapter must provide a void constructor. Alternatively, an instance of a Remote Data Adapter is supplied to Lightstreamer programmatically through a DataProviderServer instance. After initialization, Lightstreamer sets itself as the Remote Data Adapter listener, by calling the setListener method.
Data Providers are used by Lightstreamer Kernel to obtain all data to be pushed to the Clients. Any Item requested by a Client must refer to one supplied by the configured Data Adapters.
A Data Provider supplies data in a publish/subscribe way. Lightstreamer asks for data by calling the subscribe and unsubscribe methods for various Items and the Data Adapter sends ItemEvents to its listener in an asynchronous way.
A Data Adapter can also support Snapshot management. Upon subscription to an Item, the current state of the Item data can be sent to the Server before the updates. This allows the Server to maintain the Item state, by integrating the new ItemEvents into the state (in a way that depends on the Item type) and to make this state available to the Clients.
Note that the interaction between the Server and the Data Adapter and the interaction between the Server and any Client are independent activities. As a consequence, the very first ItemEvents sent by the Data Adapter to the Server for an Item just subscribed to might be processed before the Server starts feeding any client, even the client that caused the subscription to the Item to be invoked; then, such events would not be forwarded to any client. If it is desirable that a client receives all the ItemEvents that have been produced for an Item by the Data Adapter since subscription time, then the support for the Item Snapshot can be leveraged.
Lightstreamer ensures that calls to subscribe and unsubscribe for the same Item will be interleaved, without redundant calls; whenever subscribe throws an exception, the corresponding unsubscribe call is not issued.
IIndexedItemEvent
Provides to the Data Adapter an alternative interface for creating Item Events in order to send updates to Lightstreamer Kernel. In this event, a name-index association is defined for all fields. These indexes will be used by the Remote Server to iterate through all the fields. Some indexes may not be associated to fields in the event, but the number of such holes should be small. The name-index associations are local to the event and may be different even across events belonging to the same Item.
IItemEvent
Provides to the Data Adapter a base interface for creating Item Events in order to send updates to Lightstreamer Kernel. An IItemEvent object contains the new values and, in some cases, the current values of the Fields of an Item. All implementation methods should be nonblocking.
IItemEventListener
Used by Lightstreamer Kernel to receive the update events and any asynchronous severe error notification from the Data Adapter. The listener instance is supplied to the Data Adapter by Lightstreamer Kernel (through the Remote Server) through a SetListener call. Update events are specified through maps (i.e. IDictionary) that associate fields and values. Depending on the kind of subscription, the mapping for fields unchanged since the previous update can be omitted. Some alternative methods to supply update events are available, but they have been deprecated. Field values should be expressed as String; the use of byte arrays is also allowed, but it has been deprecated.