Package com.qfs.msg

Interface ISource<I,E>

Type Parameters:
I - type of the identifiers of messages
E - type of the data elements appended into message chunks
All Known Subinterfaces:
ICSVSource<I>, IJDBCSource<T>, IKeyValueSource<C>
All Known Implementing Classes:
AJDBCSource, ArrayJDBCSource, CSVSource, KeyValueSource, MapJDBCSource, NativeJDBCSource

public interface ISource<I,E>
Source interface that allows to fetch and listen data from a underlying source.

This is a generic interface meant to be implemented multiple times for CSV sources, JDBC sources, POJO sources, JMS sources...

Author:
ActiveViam
  • Method Details

    • getName

      String getName()
      Returns the name of the source.
    • getTopics

      List<String> getTopics()
      Return the list of topics supported by this source.
      Returns:
      list of topics
    • fetch

      Map<String,? extends ITopicParsingReport> fetch(Collection<? extends IMessageChannel<I,E>> channels)
      Method to retrieve all the available data (related to the topics exposed by the channels). The channel holds the configuration to transform the data and move forward through the application.

      If parsing report is enabled, the method will return reports containing information on all the parsing errors encountered. Otherwise, an empty map is returned.

      Parameters:
      channels - The channels that uses the data
      Returns:
      The parsing reports
    • listen

      IListenerKey listen(IMessageChannel<I,E> channel)
      Method to listen to the channel. The channel holds the configuration how to retrieve the data Every time there is change in the source, the information is propagated through the channel.
      Parameters:
      channel - The channel that uses the data
      Returns:
      listener token