Class FavoriteLogService

java.lang.Object
org.codelibs.fess.app.service.FavoriteLogService

public class FavoriteLogService extends Object
Service class for managing favorite log operations. Provides functionality to add URLs to user favorites and retrieve favorite URL lists. This service handles the persistence and retrieval of favorite log entries in the search system.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.codelibs.fess.opensearch.log.exbhv.FavoriteLogBhv
    Behavior class for favorite log database operations.
    protected org.codelibs.fess.mylasta.direction.FessConfig
    Configuration settings for the Fess search system.
    protected SystemHelper
    System helper for common system operations and utilities.
    protected org.codelibs.fess.opensearch.log.exbhv.UserInfoBhv
    Behavior class for user information database operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addUrl(String userCode, BiConsumer<org.codelibs.fess.opensearch.log.exentity.UserInfo,org.codelibs.fess.opensearch.log.exentity.FavoriteLog> favoriteLogLambda)
    Adds a URL to a user's favorite list.
    getUrlList(String userCode, List<String> urlList)
    Retrieves a list of URLs that are in the user's favorites from the provided URL list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • systemHelper

      protected SystemHelper systemHelper
      System helper for common system operations and utilities.
    • userInfoBhv

      protected org.codelibs.fess.opensearch.log.exbhv.UserInfoBhv userInfoBhv
      Behavior class for user information database operations.
    • favoriteLogBhv

      protected org.codelibs.fess.opensearch.log.exbhv.FavoriteLogBhv favoriteLogBhv
      Behavior class for favorite log database operations.
    • fessConfig

      protected org.codelibs.fess.mylasta.direction.FessConfig fessConfig
      Configuration settings for the Fess search system.
  • Constructor Details

    • FavoriteLogService

      public FavoriteLogService()
      Default constructor.
  • Method Details

    • addUrl

      public boolean addUrl(String userCode, BiConsumer<org.codelibs.fess.opensearch.log.exentity.UserInfo,org.codelibs.fess.opensearch.log.exentity.FavoriteLog> favoriteLogLambda)
      Adds a URL to a user's favorite list. This method looks up the user by their code and creates a new favorite log entry using the provided lambda function to populate the favorite log data.
      Parameters:
      userCode - the unique code identifying the user
      favoriteLogLambda - a lambda function that accepts UserInfo and FavoriteLog to populate the favorite log data
      Returns:
      true if the URL was successfully added to favorites, false if the user was not found
    • getUrlList

      public List<String> getUrlList(String userCode, List<String> urlList)
      Retrieves a list of URLs that are in the user's favorites from the provided URL list. This method filters the input URL list to return only those URLs that the specified user has marked as favorites.
      Parameters:
      userCode - the unique code identifying the user
      urlList - the list of URLs to check against the user's favorites
      Returns:
      a list of URLs from the input list that are in the user's favorites, or an empty list if the user is not found or has no matching favorites