Class ReadExec<R>

  • Type Parameters:
    R - The type of result.
    All Implemented Interfaces:
    Executable

    public class ReadExec<R>
    extends Processor
    implements Executable
    Implements an asynchronous read method.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReadExec​(java.lang.String functionalProfileName, java.lang.String dataPointName, ReadFunction<R> readFunction)
      Constructs a new instance.
      ReadExec​(java.lang.String functionalProfileName, java.lang.String dataPointName, ReadFunction<R> readFunction, io.reactivex.rxjava3.core.Scheduler scheduler)
      Constructs a new instance with a custom scheduler.
    • Constructor Detail

      • ReadExec

        public ReadExec​(java.lang.String functionalProfileName,
                        java.lang.String dataPointName,
                        ReadFunction<R> readFunction)
        Constructs a new instance.
        Parameters:
        functionalProfileName - the functional profile name
        dataPointName - the data point name
        readFunction - a reference to the actual method to be called
      • ReadExec

        public ReadExec​(java.lang.String functionalProfileName,
                        java.lang.String dataPointName,
                        ReadFunction<R> readFunction,
                        io.reactivex.rxjava3.core.Scheduler scheduler)
        Constructs a new instance with a custom scheduler.
        Parameters:
        functionalProfileName - the functional profile name
        dataPointName - the data point name
        readFunction - a reference to the actual method to be called
        scheduler - a task scheduler
    • Method Detail

      • process

        public void process​(ProcessingType processingType)
        Description copied from class: Processor
        Executes the processes.
        Specified by:
        process in class Processor
        Parameters:
        processingType - the type of execution
      • handleSuccess

        public void handleSuccess​(AsyncResult<R> result)
        Handles a finished process.
        Parameters:
        result - the process result
      • handleError

        public void handleError​(java.lang.Throwable t)
        Handles an error.
        Parameters:
        t - the exception that was thrown
      • getReadValue

        public R getReadValue()
        Gets the value of the read result.
        Returns:
        a value
      • getExecThrowable

        public java.lang.Throwable getExecThrowable()
        Gets the exception that was thrown.
        Returns:
        an instance of Throwable
      • cleanup

        public void cleanup()
        Cleans up disposable resources.
      • getRequestTime

        public java.time.Instant getRequestTime()
        Gets the time stamp of sending the request.
        Returns:
        an instance of Instant
      • getResponseTime

        public java.time.Instant getResponseTime()
        Gets the time stamp of receiving the response.
        Returns:
        an instance of Instant
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setFinishedNotificationReceiver

        public void setFinishedNotificationReceiver​(java.lang.Object notificationReceiver)
        Description copied from interface: Executable
        Sets an object which should receive notifications of status changes.
        Specified by:
        setFinishedNotificationReceiver in interface Executable
        Parameters:
        notificationReceiver - the receiving object