Package org.codelibs.fess.api
Class BaseApiManager
java.lang.Object
org.codelibs.fess.api.BaseApiManager
- All Implemented Interfaces:
WebApiManager
- Direct Known Subclasses:
SearchApiV2Manager,SearchEngineApiManager
Base implementation for API managers providing common functionality.
Abstract class that provides format detection and response handling for web APIs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumEnumeration of supported API format types. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseApiManager.FormatTypedetectFormatType(jakarta.servlet.http.HttpServletRequest request) Detects the format type from the request parameters.protected BaseApiManager.FormatTypegetFormatType(jakarta.servlet.http.HttpServletRequest request) Gets the format type for the request.Gets the path prefix for API endpoints.voidsetPathPrefix(String pathPrefix) Sets the path prefix for API endpoints.protected voidWrites text content to the HTTP response with specified content type and encoding.protected abstract voidwriteHeaders(jakarta.servlet.http.HttpServletResponse response) Writes custom headers to the HTTP response.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codelibs.fess.api.WebApiManager
matches, process
-
Field Details
-
pathPrefix
Path prefix for API endpoints.
-
-
Constructor Details
-
BaseApiManager
public BaseApiManager()Default constructor for BaseApiManager.
-
-
Method Details
-
getPathPrefix
Gets the path prefix for API endpoints.- Returns:
- The path prefix.
-
setPathPrefix
Sets the path prefix for API endpoints.- Parameters:
pathPrefix- The path prefix to set.
-
getFormatType
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
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.
-