use of io.spine.server.tenant.TenantAwareFunction in project core-java by SpineEventEngine.
the class CommandStoreShould method getProcessingStatus.
private ProcessingStatus getProcessingStatus(CommandEnvelope commandEnvelope) {
final TenantId tenantId = commandEnvelope.getCommandContext().getActorContext().getTenantId();
final TenantAwareFunction<CommandId, ProcessingStatus> func = new TenantAwareFunction<CommandId, ProcessingStatus>(tenantId) {
@Override
public ProcessingStatus apply(@Nullable CommandId input) {
return commandStore.getStatus(checkNotNull(input));
}
};
final ProcessingStatus result = func.execute(commandEnvelope.getCommandId());
return result;
}
Aggregations