public interface DataProvider
DataProviderServer
instance.
After initialization, Lightstreamer sets itself
as the Remote Data Adapter listener, by calling the setListener method.
Modifier and Type | Method and Description |
---|---|
void |
init(java.util.Map<java.lang.String,java.lang.String> parameters,
java.lang.String configFile)
Called by the Remote Server to provide
initialization information to the Data Adapter.
|
boolean |
isSnapshotAvailable(java.lang.String itemName)
Called by Lightstreamer Kernel through the Remote Server
to know whether the Data Adapter, after a subscription for an Item,
will send some Snapshot Item Events before sending the updates.
|
void |
setListener(ItemEventListener eventListener)
Called by the Remote Server to provide
a listener to receive the Item Events carrying data and
asynchronous error notifications for Lightstreamer Kernel.
|
void |
subscribe(java.lang.String itemName)
Called by Lightstreamer Remote Server to request data for an Item.
|
void |
unsubscribe(java.lang.String itemName)
Called by Lightstreamer Kernel through the Remote Server
to end a previous request of data for an Item.
|
void init(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String configFile) throws DataProviderException
parameters
- a Map object that contains name-value pairs corresponding
to the parameters elements supplied for the Data Adapter configuration.
Both names and values are represented as String objects.DataProviderServer.setAdapterParams(java.util.Map<java.lang.String, java.lang.String>)
method of the DataProviderServer instance.
More parameters can be added by leveraging the "init_remote" parameter
in the Proxy Adapter configuration.configFile
- The path on the local disk of the Data Adapter configuration file.
Can be null if not specified.DataProviderException
- in case an error occurs that prevents the correct
behavior of the Data Adapter.void setListener(ItemEventListener eventListener)
eventListener
- A listener.void subscribe(java.lang.String itemName) throws SubscriptionException, FailureException
if IsSnapshotAvailable(itemName) == true SNAP* [EOS] UPD* else UPD*where:
[SNAP] [EOS] UPD*where a missing snapshot is considered as an empty snapshot.
itemName
- Name of an Item.SubscriptionException
- in case the request cannot be satisfied.FailureException
- in case the method execution has caused
a severe problem that can compromise future operation of the Data Adapter.void unsubscribe(java.lang.String itemName) throws SubscriptionException, FailureException
itemName
- Name of an Item.SubscriptionException
- in case the request cannot be satisfied.FailureException
- in case the method execution has caused
a severe problem that can compromise future operation of the Data Adapter.boolean isSnapshotAvailable(java.lang.String itemName) throws SubscriptionException
itemName
- Name of an Item.SubscriptionException
- in case the Data Adapter is unable to answer to the request.