Class AiUserRateLimitDAO
java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.business.AiUserRateLimitDAO
- All Implemented Interfaces:
IAiUserRateLimitDAO
This class provides Data Access methods for AiUserRateLimit objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the tablefindByUserId(String strUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find the rate limit by user IDvoidinsert(AiUserRateLimit aiUserRateLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the tableload(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the data from the tablevoidremoveExpiredEntries(Timestamp cutoffTimestamp, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove expired rate limit entriesvoidstore(AiUserRateLimit aiUserRateLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the table
-
Constructor Details
-
AiUserRateLimitDAO
public AiUserRateLimitDAO()
-
-
Method Details
-
insert
public void insert(AiUserRateLimit aiUserRateLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table- Specified by:
insertin interfaceIAiUserRateLimitDAO- Parameters:
aiUserRateLimit- instance of the AiUserRateLimit object to insertplugin- the Plugin
-
store
public void store(AiUserRateLimit aiUserRateLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the table- Specified by:
storein interfaceIAiUserRateLimitDAO- Parameters:
aiUserRateLimit- the reference of the AiUserRateLimitplugin- the Plugin
-
delete
public void delete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the table- Specified by:
deletein interfaceIAiUserRateLimitDAO- Parameters:
nKey- The identifier of the AiUserRateLimit to deleteplugin- the Plugin
-
load
public Optional<AiUserRateLimit> load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the data from the table- Specified by:
loadin interfaceIAiUserRateLimitDAO- Parameters:
nKey- The identifier of the aiUserRateLimitplugin- the Plugin- Returns:
- The instance of the aiUserRateLimit
-
findByUserId
public Optional<AiUserRateLimit> findByUserId(String strUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find the rate limit by user ID- Specified by:
findByUserIdin interfaceIAiUserRateLimitDAO- Parameters:
strUserId- The user IDplugin- the Plugin- Returns:
- The instance of the AiUserRateLimit
-
removeExpiredEntries
public void removeExpiredEntries(Timestamp cutoffTimestamp, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove expired rate limit entries- Specified by:
removeExpiredEntriesin interfaceIAiUserRateLimitDAO- Parameters:
cutoffTimestamp- The cutoff timestampplugin- the Plugin
-