Class TriggeredScraperImpl

  • All Implemented Interfaces:
    Scraper, TriggeredScraperMBean

    public class TriggeredScraperImpl
    extends Object
    implements Scraper, TriggeredScraperMBean
    replaces the old Scraper that only could do scheduled scraping jobs Triggers have been introduced, so that in configuration "scrapeTime" has been exchanged by "triggerConfig" Some example: - 200ms scheduling is now performed by "triggerConfig: (SCHEDULED,200)" in scraper-configuration - a triggered S7 variable can be used as follows: "triggerConfig: (S7_TRIGGER_VAR,10,(%M0.3:BOOL)==(true))" meaning that Boolean in Marker-Block in Byte-Offset 0, Bit-Offset 3 is scanned every 10ms, when trigger has a rising-edge the acquirement of data-block is triggered the trigger variable must be a valid address as defined with PLC4X-S7-Driver right now boolean variables as well as numeric variables could be used as data-types available comparators are ==,!= for all data-types and >,>=,<,<= for numeric data-types
    • Constructor Detail

      • TriggeredScraperImpl

        public TriggeredScraperImpl​(ScraperConfiguration config,
                                    PlcConnectionManager plcConnectionManager,
                                    ResultHandler resultHandler,
                                    TriggerCollector triggerCollector)
                             throws ScraperException
        Creates a Scraper instance from a configuration.
        Parameters:
        config - Configuration to use.
        plcConnectionManager - external DriverManager
        resultHandler - handler the defines the processing of acquired data
        triggerCollector - the trigger collector
        Throws:
        ScraperException - something went wrong
      • TriggeredScraperImpl

        public TriggeredScraperImpl​(ScraperConfigurationTriggeredImpl config,
                                    PlcConnectionManager plcConnectionManager,
                                    ResultHandler resultHandler,
                                    TriggerCollector triggerCollector,
                                    int poolSizeScheduler,
                                    int poolSizeExecutor)
                             throws ScraperException
        Creates a Scraper instance from a configuration.
        Parameters:
        config - Configuration to use.
        plcConnectionManager - external DriverManager
        resultHandler - handler the defines the processing of acquired data
        triggerCollector - the trigger collector
        poolSizeExecutor - the pool size of the executor
        poolSizeScheduler - the pool size of the scheduler
        Throws:
        ScraperException - something went wrong
      • TriggeredScraperImpl

        public TriggeredScraperImpl​(ResultHandler resultHandler,
                                    PlcConnectionManager plcConnectionManager,
                                    List<ScrapeJob> jobs,
                                    TriggerCollector triggerCollector,
                                    long futureTimeOut)
        Creates a Scraper instance from a configuration.
        Parameters:
        plcConnectionManager - external DriverManager
        resultHandler - handler the defines the processing of acquired data
        jobs - list of jobs that scraper shall handle
        triggerCollector - a collection that centralizes the trigger requests and joins them to grouped plc requests
        futureTimeOut - max duration of future to return a result