Package org.apache.wiki.auth
Class AccountLifecycle
java.lang.Object
org.apache.wiki.auth.AccountLifecycle
What happens to a user account as the password of its owner gets older, on top of
PasswordExpiry. Each stage is optional and
is counted in days from the last time the password was changed (UserProfile.getPasswordChanged()):
- "jspwiki.credentials.expiry.warnDays": the owner is told that the password is going to expire. Only if "jspwiki.credentials.expiry.days" is set, and later than this.
- "jspwiki.credentials.lock.days": the account is locked, and its owner told. It stays locked until an administrator unlocks it.
- "jspwiki.credentials.delete.days": the account is deleted, and its owner told.
apply(Date) goes through all the accounts once. The password that has no date yet gets it, which
is when its clock starts.- Since:
- 3.0.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceTells the owners of the accounts what happens to them. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty with the number of days after which an account is deleted.static final StringProperty with the number of days after which an account is locked.static final StringProperty with the number of days after which the owner of an account is told that the password is going to expire. -
Constructor Summary
ConstructorsConstructorDescriptionAccountLifecycle(Properties props, Supplier<UserDatabase> databases, AccountLifecycle.Notifier notifier) Reads the stages from the properties. -
Method Summary
Modifier and TypeMethodDescriptionvoidGoes through all the accounts once and does what their age calls for.intReturns the days after which an account is deleted.intReturns the days after which an account is locked.intReturns the days after which the owner is told that the password is going to expire.booleanTells if any stage is on.
-
Field Details
-
PROP_WARN_DAYS
Property with the number of days after which the owner of an account is told that the password is going to expire.- See Also:
-
PROP_LOCK_DAYS
Property with the number of days after which an account is locked.- See Also:
-
PROP_DELETE_DAYS
Property with the number of days after which an account is deleted.- See Also:
-
-
Constructor Details
-
AccountLifecycle
public AccountLifecycle(Properties props, Supplier<UserDatabase> databases, AccountLifecycle.Notifier notifier) Reads the stages from the properties.- Parameters:
props- the wiki propertiesdatabases- gives the user database, which is not needed before a passnotifier- tells the owners
-
-
Method Details
-
isEnabled
Tells if any stage is on.- Returns:
trueif there is something to do for the accounts
-
getWarnDays
Returns the days after which the owner is told that the password is going to expire.- Returns:
- the days, or 0 if the owner is not told
-
getLockDays
Returns the days after which an account is locked.- Returns:
- the days, or 0 if accounts are not locked
-
getDeleteDays
Returns the days after which an account is deleted.- Returns:
- the days, or 0 if accounts are not deleted
-
apply
Goes through all the accounts once and does what their age calls for. An account that cannot be dealt with is logged and left for the next pass.- Parameters:
now- the time to count the age from
-