Search in sources :

Example 1 with TenantFunction

use of io.spine.server.tenant.TenantFunction in project core-java by SpineEventEngine.

the class InMemoryProjectionStorage method readLastHandledEventTime.

@Override
public Timestamp readLastHandledEventTime() {
    final TenantFunction<Timestamp> func = new TenantFunction<Timestamp>(isMultitenant()) {

        @Nullable
        @Override
        public Timestamp apply(@Nullable TenantId tenantId) {
            checkNotNull(tenantId);
            final Timestamp result = timestampOfLastEvent.get(tenantId);
            return result;
        }
    };
    return func.execute();
}
Also used : TenantId(io.spine.core.TenantId) Timestamp(com.google.protobuf.Timestamp) TenantFunction(io.spine.server.tenant.TenantFunction) Nullable(javax.annotation.Nullable)

Aggregations

Timestamp (com.google.protobuf.Timestamp)1 TenantId (io.spine.core.TenantId)1 TenantFunction (io.spine.server.tenant.TenantFunction)1 Nullable (javax.annotation.Nullable)1