Class ScoTransactionImpl

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final T response
    • Constructor Summary

      Constructors 
      Constructor Description
      ScoTransactionImpl(T response, Consumer<Pair<OperationInvokedReport.ReportPart, MdibVersion>> reportListener, ScoUtil scoUtil)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      T getResponse() Gets set response message.
      long getTransactionId() 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.
      void receiveIncomingReport(Pair<OperationInvokedReport.ReportPart, MdibVersion> report) Internal function to trigger reception of an incoming report.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScoTransactionImpl

        ScoTransactionImpl(T response, Consumer<Pair<OperationInvokedReport.ReportPart, MdibVersion>> reportListener, ScoUtil scoUtil)
    • Method Detail

      • 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.