Class BaseApiManager

java.lang.Object
org.codelibs.fess.api.BaseApiManager
All Implemented Interfaces:
WebApiManager
Direct Known Subclasses:
SearchApiV2Manager, SearchEngineApiManager

public abstract class BaseApiManager extends Object implements WebApiManager
Base implementation for API managers providing common functionality. Abstract class that provides format detection and response handling for web APIs.
  • Field Details

    • pathPrefix

      protected String pathPrefix
      Path prefix for API endpoints.
  • Constructor Details

    • BaseApiManager

      public BaseApiManager()
      Default constructor for BaseApiManager.
  • Method Details

    • getPathPrefix

      public String getPathPrefix()
      Gets the path prefix for API endpoints.
      Returns:
      The path prefix.
    • setPathPrefix

      public void setPathPrefix(String pathPrefix)
      Sets the path prefix for API endpoints.
      Parameters:
      pathPrefix - The path prefix to set.
    • getFormatType

      protected BaseApiManager.FormatType getFormatType(jakarta.servlet.http.HttpServletRequest request)
      Gets the format type for the request.
      Parameters:
      request - The HTTP servlet request.
      Returns:
      The format type.
    • detectFormatType

      protected BaseApiManager.FormatType detectFormatType(jakarta.servlet.http.HttpServletRequest request)
      Detects the format type from the request parameters.
      Parameters:
      request - The HTTP servlet request.
      Returns:
      The detected format type.
    • write

      protected void write(String text, String contentType, String encoding)
      Writes text content to the HTTP response with specified content type and encoding.
      Parameters:
      text - The text content to write.
      contentType - The content type for the response.
      encoding - The character encoding for the response.
    • writeHeaders

      protected abstract void writeHeaders(jakarta.servlet.http.HttpServletResponse response)
      Writes custom headers to the HTTP response.
      Parameters:
      response - The HTTP servlet response.