Package org.eblocker.server.http.service
Class ParentalControlUsageService
java.lang.Object
org.eblocker.server.http.service.ParentalControlUsageService
-
Constructor Summary
ConstructorsConstructorDescriptionParentalControlUsageService(Integer usageMinimumTime, Integer usageTimeOutAutoOff, java.time.Clock clock, DataSource dataSource, ParentalControlService parentalControlService, TrafficAccounter trafficAccounter, UserService userService) -
Method Summary
Modifier and TypeMethodDescriptionaddBonusTimeForToday(int profileId, int min) Allows to add a positive or negative number as bonus time for a given profile.getUsageAccount(Integer userId) getUsageAccount(Device device) getUsageAccount(UserModule user) voidinit()booleanstartUsage(Device device) void
-
Constructor Details
-
ParentalControlUsageService
@Inject public ParentalControlUsageService(Integer usageMinimumTime, Integer usageTimeOutAutoOff, java.time.Clock clock, DataSource dataSource, ParentalControlService parentalControlService, TrafficAccounter trafficAccounter, UserService userService)
-
-
Method Details
-
init
public void init() -
startUsage
-
stopUsage
-
getUsageAccount
-
getUsageAccount
-
getUsageAccount
-
addBonusTimeForToday
Allows to add a positive or negative number as bonus time for a given profile. The overall bonus time must be positive. A negative bonus could result in bad user experience. If bonus is large negative number The parent would have to continuously click on "+10 min" until the value is positive again. So to reduce the actual online time for that day, the parent has to update the profile's online time in the settings.- Parameters:
profileId- the profile to which the bonus is addedmin- bonus time in minutes- Returns:
- the updated user profile
-