Class TriggerCollectorImpl
- java.lang.Object
-
- org.apache.plc4x.java.scraper.triggeredscraper.triggerhandler.collector.TriggerCollectorImpl
-
- All Implemented Interfaces:
TriggerCollector
public class TriggerCollectorImpl extends Object implements TriggerCollector
default implementation for TriggerCollector
-
-
Constructor Summary
Constructors Constructor Description TriggerCollectorImpl(PlcConnectionManager plcConnectionManager)TriggerCollectorImpl(PlcConnectionManager plcConnectionManager, long schedulerInterval, long futureTimeout)TriggerCollectorImpl(PlcConnectionManager plcConnectionManager, long schedulerInterval, long futureTimeout, int poolSizeScheduler, int poolSizeExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectrequestResult(String uuid)requests the result of submitted plc request with default timeoutObjectrequestResult(String uuid, long timeout)requests the result of submitted plc requestvoidstart()starts the acquirement of triggersvoidstop()stops acquirement of triggersStringsubmitTrigger(String tag, String plcConnectionString, long interval)submits a trigger request to TriggerCollector
-
-
-
Constructor Detail
-
TriggerCollectorImpl
public TriggerCollectorImpl(PlcConnectionManager plcConnectionManager, long schedulerInterval, long futureTimeout, int poolSizeScheduler, int poolSizeExecutor)
-
TriggerCollectorImpl
public TriggerCollectorImpl(PlcConnectionManager plcConnectionManager, long schedulerInterval, long futureTimeout)
-
TriggerCollectorImpl
public TriggerCollectorImpl(PlcConnectionManager plcConnectionManager)
-
-
Method Detail
-
submitTrigger
public String submitTrigger(String tag, String plcConnectionString, long interval) throws ScraperException
submits a trigger request to TriggerCollector- Specified by:
submitTriggerin interfaceTriggerCollector- Parameters:
tag- a (plc) tag that is used for triggering procedureplcConnectionString- the connection string to the regarding sourceinterval- max awaiting time until request shall be submitted- Returns:
- a uuid under that the request is handled internally
- Throws:
ScraperException- something went wrong
-
requestResult
public Object requestResult(String uuid) throws ScraperException
requests the result of submitted plc request with default timeout- Specified by:
requestResultin interfaceTriggerCollector- Parameters:
uuid- uuid that represents the request- Returns:
- the object acquired by requesting plc instance
- Throws:
ScraperException- something went wrong
-
requestResult
public Object requestResult(String uuid, long timeout)
requests the result of submitted plc request- Specified by:
requestResultin interfaceTriggerCollector- Parameters:
uuid- uuid that represents the requesttimeout- timeout until response shall be acquired- Returns:
- the object acquired by requesting plc instance
-
start
public void start()
starts the acquirement of triggers- Specified by:
startin interfaceTriggerCollector
-
stop
public void stop()
stops acquirement of triggers- Specified by:
stopin interfaceTriggerCollector
-
-