Class ScoTransactionImpl
-
- All Implemented Interfaces:
-
org.somda.sdc.glue.consumer.sco.ScoTransaction
public class ScoTransactionImpl<T extends AbstractSetResponse> implements ScoTransaction<T>
Default implementation of ScoTransaction
The implementation supports an internal function to trigger reception of incoming reports, see receiveIncomingReport.
-
-
Constructor Summary
Constructors Constructor Description ScoTransactionImpl(T response, Consumer<Pair<OperationInvokedReport.ReportPart, MdibVersion>> reportListener, ScoUtil scoUtil)
-
Method Summary
Modifier and Type Method Description TgetResponse()Gets set response message. longgetTransactionId()Gets the transaction id. List<Pair<OperationInvokedReport.ReportPart, MdibVersion>>getReports()Gets all reports received so far. List<Pair<OperationInvokedReport.ReportPart, MdibVersion>>waitForFinalReport(Duration waitTime)Starts waiting for a final report. voidreceiveIncomingReport(Pair<OperationInvokedReport.ReportPart, MdibVersion> report)Internal function to trigger reception of an incoming report. -
-
Method Detail
-
getResponse
T getResponse()
Gets set response message.
- Returns:
a copy of the set response message of this ScoTransactionImpl.
-
getTransactionId
long getTransactionId()
Gets the transaction id.
Shortcut of accessing
getTransactionId()of getResponse.- Returns:
the transaction id of this ScoTransactionImpl.
-
getReports
List<Pair<OperationInvokedReport.ReportPart, MdibVersion>> getReports()
Gets all reports received so far.
- Returns:
Snapshot of received reports and their respective {#MdibVersion} as a copy.
-
waitForFinalReport
List<Pair<OperationInvokedReport.ReportPart, MdibVersion>> waitForFinalReport(Duration waitTime)
Starts waiting for a final report.
A report is final if isFinalReport holds true.
- Parameters:
waitTime- maximum wait time until this function returns.- Returns:
a list that holds all reports and their respective {#MdibVersion}, including the final one or an empty list if no final report has been received.
-
receiveIncomingReport
void receiveIncomingReport(Pair<OperationInvokedReport.ReportPart, MdibVersion> report)
Internal function to trigger reception of an incoming report.
Notifies waiting threads.
- Parameters:
report- the report to receive.
-
-
-
-