Record Class UserMFA.Answer
java.lang.Object
java.lang.Record
com.iizix.server.user.mfa.UserMFA.Answer
- Record Components:
outcome- What became of it.uid- The user ID the code was for, zero when there is none.userName- The user name, null when there is none.method- The method that was accepted,SignInPolicy.METHOD_TOTPorSignInPolicy.METHOD_RECOVERY; null when nothing was.waitMs- The milliseconds the account still waits, forHELD_BACK.driftSeconds- For a refused verification code: the seconds the clock of the code is off this server's, when the code would have matched withinUserMFA.DRIFT_STEPSsteps outside the verifier's window - positive when ahead, negative when behind (CC-FIX-SIGNIN-TOTP-ENROL, item 9); zero otherwise.
- Enclosing class:
UserMFA
public static record UserMFA.Answer(UserMFA.Outcome outcome, long uid, String userName, String method, long waitMs, int driftSeconds) extends Record
The answer to a code.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionAnswer(UserMFA.Outcome outcome, long uid, String userName, String method, long waitMs) An answer that names no drift of a clock.Answer(UserMFA.Outcome outcome, long uid, String userName, String method, long waitMs, int driftSeconds) Creates an instance of aAnswerrecord class.Method Summary
Modifier and TypeMethodDescriptionbooleanaccepted()Checks if the code was accepted.intReturns the value of thedriftSecondsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.outcome()Returns the value of theoutcomerecord component.final StringtoString()Returns a string representation of this record class.longuid()Returns the value of theuidrecord component.userName()Returns the value of theuserNamerecord component.longwaitMs()Returns the value of thewaitMsrecord component.
Constructor Details
Answer
An answer that names no drift of a clock.- Parameters:
outcome- What became of it.uid- The user ID the code was for, zero when there is none.userName- The user name, null when there is none.method- The method that was accepted, null when nothing was.waitMs- The milliseconds the account still waits, forHELD_BACK.
Answer
public Answer(UserMFA.Outcome outcome, long uid, String userName, String method, long waitMs, int driftSeconds) Creates an instance of aAnswerrecord class.- Parameters:
outcome- the value for theoutcomerecord componentuid- the value for theuidrecord componentuserName- the value for theuserNamerecord componentmethod- the value for themethodrecord componentwaitMs- the value for thewaitMsrecord componentdriftSeconds- the value for thedriftSecondsrecord component
Method Details
accepted
public boolean accepted()Checks if the code was accepted.- Returns:
- true for
ACCEPTED.
toString
hashCode
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.outcome
uid
userName
method
waitMs
driftSeconds
public int driftSeconds()Returns the value of thedriftSecondsrecord component.- Returns:
- the value of the
driftSecondsrecord component