001/*
002 * Copyright 2026 Revetware LLC.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.revetsec.oauth.server;
018
019import com.google.errorprone.annotations.CheckReturnValue;
020import org.jspecify.annotations.NonNull;
021import org.jspecify.annotations.Nullable;
022import javax.annotation.concurrent.Immutable;
023import java.time.Instant;
024import java.util.List;
025import java.util.Optional;
026import static java.util.Objects.requireNonNull;
027
028/**
029 * Outcome of an atomic, durable issuer store commit. An uncertain outcome never implies rollback or safe retry.
030 * @author <a href="https://www.revetkn.com">Mark Allen</a>
031 *
032 * @since 1.0.0
033 */
034@Immutable
035public enum OAuthStoreCommitStatus {
036 /** All predicates and mutations linearized durably together. */
037 COMMITTED,
038 /** An exact predicate failed with no effect. */
039 CONFLICT,
040 /** Assigned backend capacity refused the whole mutation with no eviction. */
041 CAPACITY,
042 /** The active authority/recovery/clock tuple does not match. */
043 FENCED,
044 /** No healthy admitted time was available at final validation. */
045 TIME_UNAVAILABLE,
046 /** Fresh validation time precedes the required inclusive floor. */
047 TIME_BEFORE_FLOOR,
048 /** Fresh validation time reached the original exclusive upper bound. */
049 TIME_EXPIRED,
050 /** Definitive unavailability with no effect from this callback. */
051 UNAVAILABLE,
052 /** The outcome is uncertain; reconcile before repeating a non-idempotent operation. */
053 UNKNOWN
054}