Package org.somda.sdc.glue.consumer.sco
Class ScoController
java.lang.Object
org.somda.sdc.glue.consumer.sco.ScoController
- All Implemented Interfaces:
SetServiceAccess
Controller class that is responsible for invoking set requests and processing incoming operation invoked reports.
-
Method Summary
Modifier and TypeMethodDescription<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>>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.voidprocessOperationInvokedReport(org.somda.sdc.biceps.model.message.OperationInvokedReport report) Accepts an operation invoked report and dispatches report parts to SCO transactions.
-
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:SetServiceAccessInvokes a set operation.If there is no service to access the SCO, this function returns with a cancelled future.
- Specified by:
invokein interfaceSetServiceAccess- 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:SetServiceAccessInvokes a set operation.If there is no service to access the SCO, this function returns with a cancelled future.
- Specified by:
invokein interfaceSetServiceAccess- 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:
-