Package tigase.server.xmppclient
Class RegistrationThrottling
- java.lang.Object
-
- tigase.server.xmppclient.RegistrationThrottling
-
- All Implemented Interfaces:
UnregisterAware
@Bean(name="registration-throttling", parent=Kernel.class, active=false, exportable=true) public class RegistrationThrottling extends java.lang.Object implements UnregisterAware
Created by andrzej on 19.11.2016.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classRegistrationThrottling.CleanUpTask
-
Constructor Summary
Constructors Constructor Description RegistrationThrottling()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeUnregister()Method called before bean unregister.protected booleancheckLimits(XMPPIOService service)protected booleancheckLimits(XMPPIOService service, Packet packet)protected voidcleanUp(java.util.List<java.lang.Long> registrationTimes)protected voidcleanUpFromTimer()protected voidscheduleCleanUpIfNeeded()voidstartFor(Kernel kernel)voidstopFor(Kernel kernel)
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
limit
@ConfigField(desc="Limit of allowed account registrations for IP in specified period") protected java.lang.Integer limit
-
period
@ConfigField(desc="Period for which limit is set") protected java.time.Duration period
-
-
Method Detail
-
startFor
public void startFor(Kernel kernel)
-
stopFor
public void stopFor(Kernel kernel)
-
beforeUnregister
public void beforeUnregister()
Description copied from interface:UnregisterAwareMethod called before bean unregister.- Specified by:
beforeUnregisterin interfaceUnregisterAware
-
checkLimits
protected boolean checkLimits(XMPPIOService service)
-
checkLimits
protected boolean checkLimits(XMPPIOService service, Packet packet)
-
cleanUp
protected void cleanUp(java.util.List<java.lang.Long> registrationTimes)
-
cleanUpFromTimer
protected void cleanUpFromTimer()
-
scheduleCleanUpIfNeeded
protected void scheduleCleanUpIfNeeded()
-
-