Class AiUserRateLimitDAO

java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.business.AiUserRateLimitDAO
All Implemented Interfaces:
IAiUserRateLimitDAO

@ApplicationScoped public class AiUserRateLimitDAO extends Object implements IAiUserRateLimitDAO
This class provides Data Access methods for AiUserRateLimit objects
  • 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:
      insert in interface IAiUserRateLimitDAO
      Parameters:
      aiUserRateLimit - instance of the AiUserRateLimit object to insert
      plugin - the Plugin
    • store

      public void store(AiUserRateLimit aiUserRateLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the record in the table
      Specified by:
      store in interface IAiUserRateLimitDAO
      Parameters:
      aiUserRateLimit - the reference of the AiUserRateLimit
      plugin - the Plugin
    • delete

      public void delete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a record from the table
      Specified by:
      delete in interface IAiUserRateLimitDAO
      Parameters:
      nKey - The identifier of the AiUserRateLimit to delete
      plugin - 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:
      load in interface IAiUserRateLimitDAO
      Parameters:
      nKey - The identifier of the aiUserRateLimit
      plugin - 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:
      findByUserId in interface IAiUserRateLimitDAO
      Parameters:
      strUserId - The user ID
      plugin - 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:
      removeExpiredEntries in interface IAiUserRateLimitDAO
      Parameters:
      cutoffTimestamp - The cutoff timestamp
      plugin - the Plugin