Class CommitResult

java.lang.Object
moe.kyokobot.libdave.CommitResult

public class CommitResult extends Object
Represents the result of processing an MLS commit via Session.processCommit(byte[]).

This class encapsulates the status of the operation (success, failure, ignored) and, in case of success, the changes to the group roster (added, updated, or removed keys).

  • Method Details

    • failed

      public static CommitResult failed()
    • ignored

      public static CommitResult ignored()
    • success

      public static CommitResult success(@NotNull @NotNull RosterMap rosterMap)
    • isFailed

      public boolean isFailed()
      Checks if the commit processing failed.
      Returns:
      true if the operation failed, false otherwise.
    • isIgnored

      public boolean isIgnored()
      Checks if the commit was ignored (e.g., duplicate or irrelevant).
      Returns:
      true if the commit was ignored, false otherwise.
    • getRosterMap

      @NotNull public @NotNull RosterMap getRosterMap()
      Retrieves the roster map detailing key changes resulting from the commit.

      The map keys are user IDs. The values are the new key data, or null/empty if the user's key was removed.

      Returns:
      The RosterMap with the changes.
      Throws:
      IllegalStateException - if the result is failed or ignored.