Class WriteExec<V>
- java.lang.Object
-
- com.smartgridready.communicator.async.process.Processor
-
- com.smartgridready.communicator.async.process.WriteExec<V>
-
- Type Parameters:
V- The type of value to write.
- All Implemented Interfaces:
Executable
public class WriteExec<V> extends Processor implements Executable
Implements an asynchronous read method.
-
-
Constructor Summary
Constructors Constructor Description WriteExec(java.lang.String functionalProfileName, java.lang.String dataPointName, WriteFunction<V> writeFunction)Constructs a new instance.WriteExec(java.lang.String functionalProfileName, java.lang.String dataPointName, WriteFunction<V> writeFunction, io.reactivex.rxjava3.core.Scheduler scheduler)Constructs a new instance with a custom scheduler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Cleans up disposable resources.ExecStatusgetExecStatus()Gets the execution status.java.lang.ThrowablegetExecThrowable()Gets the exception that was thrown.java.time.InstantgetRequestTime()Gets the time stamp of sending the request.java.time.InstantgetResponseTime()Gets the time stamp of receiving the response.AsyncResult<V>getResult()Gets the process result.voidprocess(ProcessingType processingType)Executes the processes.voidsetFinishedNotificationReceiver(java.lang.Object notificationReceiver)Sets an object which should receive notifications of status changes.voidsetWriteValue(V value)Sets the value to write.java.lang.StringtoString()
-
-
-
Constructor Detail
-
WriteExec
public WriteExec(java.lang.String functionalProfileName, java.lang.String dataPointName, WriteFunction<V> writeFunction)Constructs a new instance.- Parameters:
functionalProfileName- the functional profile namedataPointName- the data point namewriteFunction- a reference to the actual method to be called
-
WriteExec
public WriteExec(java.lang.String functionalProfileName, java.lang.String dataPointName, WriteFunction<V> writeFunction, io.reactivex.rxjava3.core.Scheduler scheduler)Constructs a new instance with a custom scheduler.- Parameters:
functionalProfileName- the functional profile namedataPointName- the data point namewriteFunction- a reference to the actual method to be calledscheduler- a task scheduler
-
-
Method Detail
-
process
public void process(ProcessingType processingType)
Description copied from class:ProcessorExecutes the processes.
-
setWriteValue
public void setWriteValue(V value)
Sets the value to write.- Parameters:
value- a value
-
getResult
public AsyncResult<V> getResult()
Description copied from interface:ExecutableGets the process result.- Specified by:
getResultin interfaceExecutable- Returns:
- an instance of
AsyncResultwith generic type
-
getExecStatus
public ExecStatus getExecStatus()
Gets the execution status.- Specified by:
getExecStatusin interfaceExecutable- Returns:
- an instance of
ExecStatus
-
getExecThrowable
public java.lang.Throwable getExecThrowable()
Gets the exception that was thrown.- Returns:
- an instance of
Throwable
-
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
-
cleanup
public void cleanup()
Cleans up disposable resources.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setFinishedNotificationReceiver
public void setFinishedNotificationReceiver(java.lang.Object notificationReceiver)
Description copied from interface:ExecutableSets an object which should receive notifications of status changes.- Specified by:
setFinishedNotificationReceiverin interfaceExecutable- Parameters:
notificationReceiver- the receiving object
-
-