Interface DataProviderRegistrar


  • public interface DataProviderRegistrar

    Allows a Transformer module to register itself with the Transformer core as a provider or source of data.

    When a request is made for an object that matches the object name pattern the data provider was registered with, the DataProvider.request(int, java.lang.String) method is invoked. The provider can then publish the data for the object that has been requested. Using a provider for this, instead of publishing all the objects back into the Transformer, can have several advantages:

    • The number of objects cached by the core which are not subscribed to is reduced.
    • The number of updates for objects which are not subscribed to is reduced.
    • The module itself may be able to reduce the number of calculations it needs to perform since it only needs to publish the data which has been requested.

    For example, a Transformer module could subscribe to some objects and calculate time intervalised data (used for producing charts) for periods of 5 minutes, 30 minutes, 1 day and 7 days. This could potentially create a very large amount of type 3 record data. Each time intervalised period for each object could be stored in a database, and would only be published to the Transformer if the particular object and time period was requested from the module.

    See Also:
    DataProvider
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deregister​(java.lang.String objectNamePattern, DataProvider dataProvider)
      Deregisters the data provider with the Transformer core for the specified object name pattern.
      void register​(java.lang.String objectNamePattern, DataProvider dataProvider)
      Registers the specified data provider with the Transformer core for the specified object name pattern.
    • Method Detail

      • register

        void register​(java.lang.String objectNamePattern,
                      DataProvider dataProvider)

        Registers the specified data provider with the Transformer core for the specified object name pattern. The data provider will be informed of any requests for objects with names that match the pattern.

        If two data providers are registered with a pattern that a requested object name matches (e.g. a data provider has been registered for /LO/* and another has been registered /??/VOD, and the object name /LO/VOD is requested), then the first provider that was registered will be informed of the request. If it returns DataProviderResponse.OK, then the second provider will not be informed of the request. The second provider will only be informed of the request if the first one returns DataProviderResponse.DENY.

        Parameters:
        objectNamePattern - The object name pattern the provider is interested in.
        dataProvider - The data provider that should be informed when a request for an object name matching the specified pattern is made.
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or dataProvider arguments are null.
      • deregister

        void deregister​(java.lang.String objectNamePattern,
                        DataProvider dataProvider)

        Deregisters the data provider with the Transformer core for the specified object name pattern. The data provider will no longer be informed of any requests for objects with names that match the pattern.

        Parameters:
        objectNamePattern - The object name pattern the provider was registered with.
        dataProvider - The data provider that should be informed when a request for an object name matching the specified pattern is made.
        Throws:
        java.lang.NullPointerException - If either the objectNamePattern or dataProvider arguments are null.