Class SearchApiV2Manager

java.lang.Object
org.codelibs.fess.api.BaseApiManager
org.codelibs.fess.api.v2.SearchApiV2Manager
All Implemented Interfaces:
WebApiManager

public class SearchApiV2Manager extends BaseApiManager
Web API manager for the /api/v2 surface.

This manager registers itself under the /api/v2 path prefix and dispatches by sub-path to DI-managed handlers.

All responses use V2EnvelopeWriter so the wire shape stays uniform: a top-level {"response": {...}} envelope with status plus either a payload or an error object.

  • Field Details

    • searchHandler

      protected SearchHandler searchHandler
      Handles POST /api/v2/search.
    • scrollSearchHandler

      protected ScrollSearchHandler scrollSearchHandler
      Handles GET /api/v2/documents/all (scroll over all matching documents).
    • favoriteGetHandler

      protected FavoriteGetHandler favoriteGetHandler
      Handles GET /api/v2/documents/{id}/favorite (read favorite state).
    • favoritePostHandler

      protected FavoritePostHandler favoritePostHandler
      Handles POST /api/v2/documents/{id}/favorite (toggle favorite state).
    • favoritesListHandler

      protected FavoritesListHandler favoritesListHandler
      Handles GET /api/v2/favorites (list favorited doc ids in a previously issued search result).
    • meHandler

      protected MeHandler meHandler
      Handles GET /api/v2/auth/me (current authenticated user).
    • logoutHandler

      protected LogoutHandler logoutHandler
      Handles POST /api/v2/auth/logout.
    • passwordChangeHandler

      protected PasswordChangeHandler passwordChangeHandler
      Handles POST /api/v2/auth/password (change the current user's password).
    • uiConfigHandler

      protected UiConfigHandler uiConfigHandler
      Handles GET /api/v2/ui/config (SPA bootstrap configuration).
    • clickHandler

      protected ClickHandler clickHandler
      Handles POST /api/v2/click (click-through logging).
    • chatHandler

      protected ChatHandler chatHandler
      Handles POST /api/v2/chat (single-shot chat completion).
    • chatStreamHandler

      protected ChatStreamHandler chatStreamHandler
      Handles POST /api/v2/chat/stream (server-sent-event chat stream).
    • chatSessionClearHandler

      protected ChatSessionClearHandler chatSessionClearHandler
      Handles DELETE /api/v2/chat/sessions/{session_id} (clear a chat session).
    • cacheHandler

      protected CacheHandler cacheHandler
      Handles GET /api/v2/cache/{id} (cached document content).
    • healthHandler

      protected HealthHandler healthHandler
      Handles GET /api/v2/health.
    • suggestWordsHandler

      protected SuggestWordsHandler suggestWordsHandler
      Handles GET /api/v2/suggest-words.
    • labelsHandler

      protected LabelsHandler labelsHandler
      Handles GET /api/v2/labels.
    • popularWordsHandler

      protected PopularWordsHandler popularWordsHandler
      Handles GET /api/v2/popular-words.
    • loginHandler

      protected LoginHandler loginHandler
      Handles POST /api/v2/auth/login.
    • relatedQueriesHandler

      protected RelatedQueriesHandler relatedQueriesHandler
      Handles GET /api/v2/related-queries (related query suggestions).
    • relatedContentHandler

      protected RelatedContentHandler relatedContentHandler
      Handles GET /api/v2/related-content (related HTML content).
    • originValidator

      protected OriginValidator originValidator
      Validates the request origin for the baseline CSRF Origin layer (unsafe methods).
  • Constructor Details

    • SearchApiV2Manager

      public SearchApiV2Manager()
      Constructor — pins the path prefix to /api/v2.
  • Method Details

    • register

      @PostConstruct public void register()
      Registers this manager with the global WebApiManagerFactory once Lasta DI finishes injecting dependencies.
    • matches

      public boolean matches(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: WebApiManager
      Checks if the request matches this API manager.
      Parameters:
      request - The HTTP servlet request.
      Returns:
      True if the request matches, false otherwise.
    • process

      public void process(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Description copied from interface: WebApiManager
      Processes the request through this API manager.
      Parameters:
      request - The HTTP servlet request.
      response - The HTTP servlet response.
      chain - The filter chain.
      Throws:
      IOException - If an input/output error occurs.
      jakarta.servlet.ServletException - If a servlet error occurs.
    • writeHeaders

      protected void writeHeaders(jakarta.servlet.http.HttpServletResponse response)
      Description copied from class: BaseApiManager
      Writes custom headers to the HTTP response.
      Specified by:
      writeHeaders in class BaseApiManager
      Parameters:
      response - The HTTP servlet response.