Class ScoController

java.lang.Object
org.somda.sdc.glue.consumer.sco.ScoController
All Implemented Interfaces:
SetServiceAccess

public class ScoController extends Object implements SetServiceAccess
Controller class that is responsible for invoking set requests and processing incoming operation invoked reports.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends org.somda.sdc.biceps.model.message.AbstractSet, V extends org.somda.sdc.biceps.model.message.AbstractSetResponse>
    com.google.common.util.concurrent.ListenableFuture<ScoTransaction<V>>
    invoke(T setRequest, Class<V> responseClass)
    Invokes a set operation.
    <T extends org.somda.sdc.biceps.model.message.AbstractSet, V extends org.somda.sdc.biceps.model.message.AbstractSetResponse>
    com.google.common.util.concurrent.ListenableFuture<ScoTransaction<V>>
    invoke(T setRequest, Consumer<org.somda.sdc.biceps.model.message.OperationInvokedReport.ReportPart> reportListener, Class<V> responseClass)
    Invokes a set operation.
    void
    processOperationInvokedReport(org.somda.sdc.biceps.model.message.OperationInvokedReport report)
    Accepts an operation invoked report and dispatches report parts to SCO transactions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • invoke

      public <T extends org.somda.sdc.biceps.model.message.AbstractSet, V extends org.somda.sdc.biceps.model.message.AbstractSetResponse> com.google.common.util.concurrent.ListenableFuture<ScoTransaction<V>> invoke(T setRequest, Class<V> responseClass)
      Description copied from interface: SetServiceAccess
      Invokes a set operation.

      If there is no service to access the SCO, this function returns with a cancelled future.

      Specified by:
      invoke in interface SetServiceAccess
      Type Parameters:
      T - the set request type.
      V - the set response type.
      Parameters:
      setRequest - the set request to send to the remote peer.
      responseClass - the expected response class (due to type erasure cannot be designated generically.
      Returns:
      a future to listen for the SCO transaction (which includes the set response).
    • invoke

      public <T extends org.somda.sdc.biceps.model.message.AbstractSet, V extends org.somda.sdc.biceps.model.message.AbstractSetResponse> com.google.common.util.concurrent.ListenableFuture<ScoTransaction<V>> invoke(T setRequest, @Nullable Consumer<org.somda.sdc.biceps.model.message.OperationInvokedReport.ReportPart> reportListener, Class<V> responseClass)
      Description copied from interface: SetServiceAccess
      Invokes a set operation.

      If there is no service to access the SCO, this function returns with a cancelled future.

      Specified by:
      invoke in interface SetServiceAccess
      Type Parameters:
      T - the set request type.
      V - the set response type.
      Parameters:
      setRequest - the set request to send to the remote peer.
      reportListener - a callback function that accepts reports being received after invocation.
      responseClass - the expected response class (due to type erasure cannot be designated generically.
      Returns:
      a future to listen for the SCO transaction (which includes the set response).
    • processOperationInvokedReport

      public void processOperationInvokedReport(org.somda.sdc.biceps.model.message.OperationInvokedReport report)
      Accepts an operation invoked report and dispatches report parts to SCO transactions.
      Parameters:
      report - the report to dispatch (note that a report can contain multiple report parts that belong to different transaction.
      See Also: