Class CommitResult
java.lang.Object
moe.kyokobot.libdave.CommitResult
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 Summary
Modifier and TypeMethodDescriptionstatic CommitResultfailed()Returns the result for a commit that failed to process.@NotNull RosterMapRetrieves the roster map detailing key changes resulting from the commit.static CommitResultignored()Returns the result for a commit that was ignored.booleanisFailed()Checks if the commit processing failed.booleanChecks if the commit was ignored (e.g., duplicate or irrelevant).static CommitResultCreates the result for a successfully processed commit.
-
Method Details
-
failed
Returns the result for a commit that failed to process.- Returns:
- The shared failed result.
-
ignored
Returns the result for a commit that was ignored.- Returns:
- The shared ignored result.
-
success
Creates the result for a successfully processed commit.- Parameters:
rosterMap- The roster changes resulting from the commit.- Returns:
- A successful result carrying
rosterMap.
-
isFailed
public boolean isFailed()Checks if the commit processing failed.- Returns:
trueif the operation failed,falseotherwise.
-
isIgnored
public boolean isIgnored()Checks if the commit was ignored (e.g., duplicate or irrelevant).- Returns:
trueif the commit was ignored,falseotherwise.
-
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
RosterMapwith the changes. - Throws:
IllegalStateException- if the result is failed or ignored.
-