Search in sources :

Example 1 with TenantAwareFunction

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;
}
Also used : TenantId(io.spine.users.TenantId) TenantAwareFunction(io.spine.server.tenant.TenantAwareFunction) CommandId(io.spine.base.CommandId) Nullable(javax.annotation.Nullable)

Aggregations

CommandId (io.spine.base.CommandId)1 TenantAwareFunction (io.spine.server.tenant.TenantAwareFunction)1 TenantId (io.spine.users.TenantId)1 Nullable (javax.annotation.Nullable)1