Package org.cyclos.impl.access
Interface FailedActionHandler
-
public interface FailedActionHandlerHandles the failed attempts to perform an action
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearGuestFailures(FailedAction action, String remoteAddress)Clears all the guest failures for the given action and remote addressvoidclearPasswordFailures(BasicUser user, PasswordType passwordType, boolean forgot)Clears all the password failures for the given user and password type, either in normal or forgot password modevoidclearPinFailures(Pin pin)Clears all the pin failures for the givenPinvoidclearUserFailures(FailedAction action, BasicUser user)Clears all the user failures for the given action and uservoidclearVoucherPinFailures(Voucher voucher)Clears all the voucher pin failures for the givenVoucherintcountGuestFailures(FailedAction action, String remoteAddress)Returns the number of guest failures for the given action and remote addressintcountPasswordFailures(BasicUser user, PasswordType passwordType, boolean forgot)Returns the number of password failures for the given user and password type, either in normal or forgot password mode.intcountPinFailures(Pin pin)Returns the number of pin failures for the given pinintcountUserFailures(FailedAction action, BasicUser user)Returns the number of user failures for the given action and user.intcountVoucherPinFailures(Voucher voucher)Returns the number of voucher pin failures for the given voucherbooleanrecordAndBlockUserIfMaxReached(FailedAction action, BasicUser user, Integer max, UserAlertType alertType)Records an action failure, blocks the user (if null use the logged user) if the max has been reached and generates an user alert.booleanrecordBlockedUserFailedAction(UserLocatorVO locator)Registers a transaction end listener to actually record theFailedAction.BLOCKED_USERguest action.booleanrecordGuestFailure(FailedAction action, String remoteAddress, UserLocatorVO locator, Integer maxAttempts, TimeInterval blockTime)Registers a transaction end listener to actually record the action failure.booleanrecordPasswordFailure(BasicUser user, PasswordType passwordType, boolean forgot)Registers a transaction end listener to actually record the password failure, either in normal or forgot password mode.booleanrecordPinFailure(Pin pin, Integer maxAttempts, Runnable onMaxReached)Registers a transaction end listener to actually record the pin failure.booleanrecordUserFailure(FailedAction action, BasicUser user, Integer maxAttempts, Runnable onMaxReached)Registers a transaction end listener to actually record the user action failure.booleanrecordVoucherPinFailure(Voucher voucher, Integer maxAttempts, Runnable onMaxReached)Registers a transaction end listener to actually record the voucher pin failure.
-
-
-
Method Detail
-
clearGuestFailures
void clearGuestFailures(FailedAction action, String remoteAddress)
Clears all the guest failures for the given action and remote address
-
clearPasswordFailures
void clearPasswordFailures(BasicUser user, PasswordType passwordType, boolean forgot)
Clears all the password failures for the given user and password type, either in normal or forgot password mode
-
clearUserFailures
void clearUserFailures(FailedAction action, BasicUser user)
Clears all the user failures for the given action and user
-
clearVoucherPinFailures
void clearVoucherPinFailures(Voucher voucher)
Clears all the voucher pin failures for the givenVoucher
-
countGuestFailures
int countGuestFailures(FailedAction action, String remoteAddress)
Returns the number of guest failures for the given action and remote address
-
countPasswordFailures
int countPasswordFailures(BasicUser user, PasswordType passwordType, boolean forgot)
Returns the number of password failures for the given user and password type, either in normal or forgot password mode.
-
countPinFailures
int countPinFailures(Pin pin) throws FrameworkException
Returns the number of pin failures for the given pin- Throws:
FrameworkException
-
countUserFailures
int countUserFailures(FailedAction action, BasicUser user)
Returns the number of user failures for the given action and user.
-
countVoucherPinFailures
int countVoucherPinFailures(Voucher voucher) throws FrameworkException
Returns the number of voucher pin failures for the given voucher- Throws:
FrameworkException
-
recordAndBlockUserIfMaxReached
boolean recordAndBlockUserIfMaxReached(FailedAction action, BasicUser user, Integer max, UserAlertType alertType)
Records an action failure, blocks the user (if null use the logged user) if the max has been reached and generates an user alert. Also returns if the muser was blocked, so callers can already do some logic regarding it.
-
recordBlockedUserFailedAction
boolean recordBlockedUserFailedAction(UserLocatorVO locator)
Registers a transaction end listener to actually record theFailedAction.BLOCKED_USERguest action. If so, calls the listener in the new transaction, after the current transaction.
Also, returns if the maximum attempts has been reached in the period defined for the given action, so callers can already do some logic regarding it.- Parameters:
locator- the located user that was blocked
-
recordGuestFailure
boolean recordGuestFailure(FailedAction action, String remoteAddress, UserLocatorVO locator, Integer maxAttempts, TimeInterval blockTime)
Registers a transaction end listener to actually record the action failure. If so, calls the listener in the new transaction, after the current transaction. Also returns if the maximum attempts has been reached in the last hour, so callers can already do some logic regarding it.
-
recordPasswordFailure
boolean recordPasswordFailure(BasicUser user, PasswordType passwordType, boolean forgot)
Registers a transaction end listener to actually record the password failure, either in normal or forgot password mode. Blocks the password if the maximum was actually reached.
-
recordPinFailure
boolean recordPinFailure(Pin pin, Integer maxAttempts, Runnable onMaxReached)
Registers a transaction end listener to actually record the pin failure. If so, calls the onMaxReached in the new transaction, after the current transaction. Also returns if the maximum attempts has been reached, so callers can already do some logic regarding it.
-
recordUserFailure
boolean recordUserFailure(FailedAction action, BasicUser user, Integer maxAttempts, Runnable onMaxReached)
Registers a transaction end listener to actually record the user action failure. If so, calls the onMaxReached in the new transaction, after the current transaction. Also returns if the maximum attempts has been reached, so callers can already do some logic regarding it.
-
recordVoucherPinFailure
boolean recordVoucherPinFailure(Voucher voucher, Integer maxAttempts, Runnable onMaxReached)
Registers a transaction end listener to actually record the voucher pin failure. If so, calls the onMaxReached in the new transaction, after the current transaction. Also returns if the maximum attempts has been reached, so callers can already do some logic regarding it.
-
-