Package org.codelibs.fess.util
Class ComponentUtil
java.lang.Object
org.codelibs.fess.util.ComponentUtil
Utility class for accessing system components and dependencies.
Provides centralized access to various helpers, managers, and services throughout the Fess application.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the container is available.static voiddoInitProcesses(Consumer<? super Runnable> action) Executes all initialization processes.static AccessTokenHelperGets the access token helper component.static ActivityHelperGets the activity helper component.static AuthenticationManagerGets the authentication manager component.static ChatApiHelperGets the chat API helper component.static ChatClientGets the chat client component.static ChatContentFetcherGets the chat content fetcher component.static ChatSessionManagerGets the chat session manager component.static org.codelibs.core.crypto.CachedCipherGets a cached cipher by name.static <T> TgetComponent(Class<T> clazz) Gets a component by its class type.static <T> TgetComponent(String componentName) Gets a component by its name.static CoordinatorHelperGets the coordinator helper component.static CorsHandlerFactoryGets the CORS handler factory component.static org.codelibs.fess.crawler.client.CrawlerClientCreatorGets the crawler client creator component.static org.codelibs.fess.crawler.client.CrawlerClientFactoryGets the crawler client factory component.static CrawlerStatsHelperGets the crawler stats helper component.static CrawlingConfigHelperGets the crawling configuration helper component.static CrawlingInfoHelperGets the crawling info helper component.static CurlHelperGets the curl helper component.static org.codelibs.fess.crawler.service.DataService<org.codelibs.fess.crawler.entity.OpenSearchAccessResult> Gets the data service component.static DataStoreFactoryGets the data store factory component.static DictionaryManagerGets the dictionary manager component.static DocumentHelperGets the document helper component.static DuplicateHostHelperGets the duplicate host helper component.static org.codelibs.fess.crawler.extractor.ExtractorFactoryGets the extractor factory component.static org.codelibs.fess.mylasta.direction.FessConfigGets the Fess configuration component.static FileTypeHelperGets the file type helper component.static IndexingHelperGets the indexing helper component.static IndexUpdaterGets the index updater component.static IngestFactoryGets the ingest factory component.static IntervalControlHelperGets the interval control helper component.static JobExecutorgetJobExecutor(String name) Gets a job executor by name.static JobHelperGets the job helper component.static org.lastaflute.job.JobManagerGets the job manager component.static KeyMatchHelperGets the key match helper component.static LabelTypeHelperGets the label type helper component.static LanguageHelperGets the language helper component.static LdapManagerGets the LDAP manager component.static LoginRateLimiterGets the v2 login rate limiter component.static LogNotificationHelperGets the log notification helper component.static MarkdownRendererGets the markdown renderer component.static org.lastaflute.core.message.MessageManagerGets the message manager component.static NotificationHelperGets the notification helper component.static PasswordHashHelperGets the password hash helper component.static PathMappingHelperGets the path mapping helper component.static PermissionHelperGets the permission helper component.static PluginHelperGets the plugin helper component.static PopularWordHelperGets the popular word helper component.static org.lastaflute.core.security.PrimaryCipherGets the primary cipher component.static ProcessHelperGets the process helper component.static ProtocolHelperGets the protocol helper component.static QueryFieldConfigGets the query field configuration.static QueryHelperGets the query helper component.static QueryParserGets the query parser component.static QueryProcessorGets the query processor component.static QueryStringBuilderGets the query string builder component.static RankFusionProcessorGets the rank fusion processor component.static RateLimitHelperGets the rate limit helper component.static RelatedContentHelperGets the related content helper component.static RelatedQueryHelperGets the related query helper component.static org.lastaflute.web.servlet.request.RequestManagerGets the request manager component.static org.lastaflute.web.servlet.request.ResponseManagerGets the response manager component.static RoleQueryHelperGets the role query helper component.static SambaHelperGets the Samba helper component.static ScriptEngineFactoryGets the script engine factory component.static SearchEngineClientGets the search engine client component.static SearchHelperGets the search helper component.static SearchLogHelperGets the search log helper component.static SessionCsrfTokenManagerGets the session-scoped CSRF token manager component used by the v2 API.static SseResponseHelperGets the SSE response helper component.static SsoManagerGets the SSO manager component.static StaticThemeInstallerGets the static theme installer component.static StaticThemeResponderGets the static theme responder component.static SuggestHelperGets the suggest helper component.static SystemHelperGets the system helper component.static org.codelibs.core.misc.DynamicPropertiesGets the system properties.static ThemeHelperGets the theme helper component.static ThemeRegistryGets the theme registry component.static ThumbnailManagerGets the thumbnail manager component.static UserAgentHelperGets the user agent helper component.static UserInfoHelperGets the user info helper component.static CsrfRequirementGets the v2 CSRF requirement component.static DocIdValidatorGets the v2 document id validator component.static V2EnvelopeWriterGets the v2 envelope writer component.static V2JsonBodyGets the v2 JSON body reader component.static UserPayloadsGets the v2 user payload builder component.static ViewHelperGets the view helper component.static VirtualHostHelperGets the virtual host helper component.static WebApiManagerFactoryGets the web API manager factory component.static booleanhasComponent(String componentKey) Checks if a component is available.static booleanChecks if ingest factory is available.static booleanChecks if popular word helper is available.static booleanChecks if query helper is available.static booleanChecks if query parser is available.static booleanChecks if related query helper is available.static booleanChecks if the request manager is available in the container.static booleanChecks if view helper is available.static voidprocessAfterContainerInit(Runnable process) Processes a runnable after container initialization.static voidRegisters a component instance with a name.static voidsetFessConfig(org.codelibs.fess.mylasta.direction.FessConfig fessConfig) For test purpose only.
-
Method Details
-
processAfterContainerInit
Processes a runnable after container initialization.- Parameters:
process- The process to run after container init.
-
doInitProcesses
Executes all initialization processes.- Parameters:
action- The action to perform on each initialization process.
-
getCipher
Gets a cached cipher by name.- Parameters:
cipherName- The cipher name.- Returns:
- The cached cipher.
-
getSystemProperties
public static org.codelibs.core.misc.DynamicProperties getSystemProperties()Gets the system properties.- Returns:
- The dynamic properties.
-
getSystemHelper
Gets the system helper component.- Returns:
- The system helper.
-
getViewHelper
Gets the view helper component.- Returns:
- The view helper.
-
getSambaHelper
Gets the Samba helper component.- Returns:
- The Samba helper.
-
getQueryHelper
Gets the query helper component.- Returns:
- The query helper.
-
getQueryFieldConfig
Gets the query field configuration.- Returns:
- The query field config.
-
getQueryProcessor
Gets the query processor component.- Returns:
- The query processor.
-
getLabelTypeHelper
Gets the label type helper component.- Returns:
- The label type helper.
-
getSearchLogHelper
Gets the search log helper component.- Returns:
- The search log helper.
-
getCrawlingConfigHelper
Gets the crawling configuration helper component.- Returns:
- The crawling config helper.
-
getCrawlingInfoHelper
Gets the crawling info helper component.- Returns:
- The crawling info helper.
-
getPopularWordHelper
Gets the popular word helper component.- Returns:
- The popular word helper.
-
getPathMappingHelper
Gets the path mapping helper component.- Returns:
- The path mapping helper.
-
getDuplicateHostHelper
Gets the duplicate host helper component.- Returns:
- The duplicate host helper.
-
getProcessHelper
Gets the process helper component.- Returns:
- The process helper.
-
getJobHelper
Gets the job helper component.- Returns:
- The job helper.
-
getWebApiManagerFactory
Gets the web API manager factory component.- Returns:
- The web API manager factory.
-
getUserAgentHelper
Gets the user agent helper component.- Returns:
- The user agent helper.
-
getDataStoreFactory
Gets the data store factory component.- Returns:
- The data store factory.
-
getIntervalControlHelper
Gets the interval control helper component.- Returns:
- The interval control helper.
-
getExtractorFactory
public static org.codelibs.fess.crawler.extractor.ExtractorFactory getExtractorFactory()Gets the extractor factory component.- Returns:
- The extractor factory.
-
getJobExecutor
Gets a job executor by name.- Parameters:
name- The name of the job executor.- Returns:
- The job executor instance.
-
getFileTypeHelper
Gets the file type helper component.- Returns:
- The file type helper.
-
getIndexUpdater
Gets the index updater component.- Returns:
- The index updater.
-
getKeyMatchHelper
Gets the key match helper component.- Returns:
- The key match helper.
-
getIndexingHelper
Gets the indexing helper component.- Returns:
- The indexing helper.
-
getUserInfoHelper
Gets the user info helper component.- Returns:
- The user info helper.
-
getMessageManager
public static org.lastaflute.core.message.MessageManager getMessageManager()Gets the message manager component.- Returns:
- The message manager.
-
getDictionaryManager
Gets the dictionary manager component.- Returns:
- The dictionary manager.
-
getDataService
public static org.codelibs.fess.crawler.service.DataService<org.codelibs.fess.crawler.entity.OpenSearchAccessResult> getDataService()Gets the data service component.- Returns:
- The data service.
-
getSearchEngineClient
Gets the search engine client component.- Returns:
- The search engine client.
-
getFessConfig
public static org.codelibs.fess.mylasta.direction.FessConfig getFessConfig()Gets the Fess configuration component.- Returns:
- The Fess config.
-
getSuggestHelper
Gets the suggest helper component.- Returns:
- The suggest helper.
-
getRoleQueryHelper
Gets the role query helper component.- Returns:
- The role query helper.
-
getLdapManager
Gets the LDAP manager component.- Returns:
- The LDAP manager.
-
getActivityHelper
Gets the activity helper component.- Returns:
- The activity helper.
-
getRequestManager
public static org.lastaflute.web.servlet.request.RequestManager getRequestManager()Gets the request manager component.- Returns:
- The request manager.
-
getResponseManager
public static org.lastaflute.web.servlet.request.ResponseManager getResponseManager()Gets the response manager component.- Returns:
- The response manager.
-
getJobManager
public static org.lastaflute.job.JobManager getJobManager()Gets the job manager component.- Returns:
- The job manager.
-
getDocumentHelper
Gets the document helper component.- Returns:
- The document helper.
-
getQueryParser
Gets the query parser component.- Returns:
- The query parser.
-
getPermissionHelper
Gets the permission helper component.- Returns:
- The permission helper.
-
getPasswordHashHelper
Gets the password hash helper component.- Returns:
- The password hash helper.
-
getSsoManager
Gets the SSO manager component.- Returns:
- The SSO manager.
-
getThumbnailManager
Gets the thumbnail manager component.- Returns:
- The thumbnail manager.
-
getAuthenticationManager
Gets the authentication manager component.- Returns:
- The authentication manager.
-
getPrimaryCipher
public static org.lastaflute.core.security.PrimaryCipher getPrimaryCipher()Gets the primary cipher component.- Returns:
- The primary cipher.
-
getCrawlerClientFactory
public static org.codelibs.fess.crawler.client.CrawlerClientFactory getCrawlerClientFactory()Gets the crawler client factory component.- Returns:
- The crawler client factory.
-
getCrawlerClientCreator
public static org.codelibs.fess.crawler.client.CrawlerClientCreator getCrawlerClientCreator()Gets the crawler client creator component.- Returns:
- The crawler client creator.
-
getRelatedQueryHelper
Gets the related query helper component.- Returns:
- The related query helper.
-
getRelatedContentHelper
Gets the related content helper component.- Returns:
- The related content helper.
-
getVirtualHostHelper
Gets the virtual host helper component.- Returns:
- The virtual host helper.
-
getAccessTokenHelper
Gets the access token helper component.- Returns:
- The access token helper.
-
getRateLimitHelper
Gets the rate limit helper component.- Returns:
- The rate limit helper.
-
getLoginRateLimiter
Gets the v2 login rate limiter component.- Returns:
- The login rate limiter (shared singleton).
-
getSessionCsrfTokenManager
Gets the session-scoped CSRF token manager component used by the v2 API.- Returns:
- The session CSRF token manager (shared singleton).
-
getV2EnvelopeWriter
Gets the v2 envelope writer component.- Returns:
- The v2 envelope writer.
-
getV2JsonBody
Gets the v2 JSON body reader component.- Returns:
- The v2 JSON body reader.
-
getV2UserPayloads
Gets the v2 user payload builder component.- Returns:
- The v2 user payload builder.
-
getV2CsrfRequirement
Gets the v2 CSRF requirement component.- Returns:
- The v2 CSRF requirement component.
-
getV2DocIdValidator
Gets the v2 document id validator component.- Returns:
- The v2 document id validator.
-
getSseResponseHelper
Gets the SSE response helper component.- Returns:
- The SSE response helper.
-
getThemeRegistry
Gets the theme registry component.- Returns:
- The theme registry (shared singleton).
-
getStaticThemeResponder
Gets the static theme responder component.- Returns:
- The static theme responder (shared singleton).
-
getStaticThemeInstaller
Gets the static theme installer component.- Returns:
- The static theme installer (shared singleton).
-
getQueryStringBuilder
Gets the query string builder component.- Returns:
- The query string builder.
-
getCurlHelper
Gets the curl helper component.- Returns:
- The curl helper.
-
getCoordinatorHelper
Gets the coordinator helper component.- Returns:
- The coordinator helper.
-
getLanguageHelper
Gets the language helper component.- Returns:
- The language helper.
-
getPluginHelper
Gets the plugin helper component.- Returns:
- The plugin helper.
-
getThemeHelper
Gets the theme helper component.- Returns:
- The theme helper.
-
getSearchHelper
Gets the search helper component.- Returns:
- The search helper.
-
getNotificationHelper
Gets the notification helper component.- Returns:
- The notification helper.
-
getLogNotificationHelper
Gets the log notification helper component.- Returns:
- The log notification helper.
-
getIngestFactory
Gets the ingest factory component.- Returns:
- The ingest factory.
-
getScriptEngineFactory
Gets the script engine factory component.- Returns:
- The script engine factory.
-
getCrawlerStatsHelper
Gets the crawler stats helper component.- Returns:
- The crawler stats helper.
-
getCorsHandlerFactory
Gets the CORS handler factory component.- Returns:
- The CORS handler factory.
-
getRankFusionProcessor
Gets the rank fusion processor component.- Returns:
- The rank fusion processor.
-
getProtocolHelper
Gets the protocol helper component.- Returns:
- The protocol helper.
-
getChatSessionManager
Gets the chat session manager component.- Returns:
- The chat session manager.
-
getChatApiHelper
Gets the chat API helper component.- Returns:
- The chat API helper.
-
getChatClient
Gets the chat client component.- Returns:
- The chat client.
-
getChatContentFetcher
Gets the chat content fetcher component.- Returns:
- the chat content fetcher
-
getMarkdownRenderer
Gets the markdown renderer component.- Returns:
- The markdown renderer.
-
getComponent
Gets a component by its class type.- Type Parameters:
T- The type of the component.- Parameters:
clazz- The class of the component to retrieve.- Returns:
- The component instance.
-
getComponent
Gets a component by its name.- Type Parameters:
T- The type of the component.- Parameters:
componentName- The name of the component to retrieve.- Returns:
- The component instance.
-
hasComponent
Checks if a component is available.- Parameters:
componentKey- The key of the component to check.- Returns:
- True if the component is available, false otherwise.
-
hasQueryParser
public static boolean hasQueryParser()Checks if query parser is available.- Returns:
- True if query parser is available, false otherwise.
-
hasRequestManager
public static boolean hasRequestManager()Checks if the request manager is available in the container. Useful for callers that may run outside a web-request scope (e.g. unit tests or background jobs) and need to avoidComponentNotFoundExceptionorNullPointerExceptionfromgetRequestManager().- Returns:
- True if the request manager component is registered, false otherwise.
-
hasViewHelper
public static boolean hasViewHelper()Checks if view helper is available.- Returns:
- True if view helper is available, false otherwise.
-
hasQueryHelper
public static boolean hasQueryHelper()Checks if query helper is available.- Returns:
- True if query helper is available, false otherwise.
-
hasPopularWordHelper
public static boolean hasPopularWordHelper()Checks if popular word helper is available.- Returns:
- True if popular word helper is available, false otherwise.
-
hasRelatedQueryHelper
public static boolean hasRelatedQueryHelper()Checks if related query helper is available.- Returns:
- True if related query helper is available, false otherwise.
-
hasIngestFactory
public static boolean hasIngestFactory()Checks if ingest factory is available.- Returns:
- True if ingest factory is available, false otherwise.
-
available
public static boolean available()Checks if the container is available.- Returns:
- True if the container is available, false otherwise.
-
setFessConfig
public static void setFessConfig(org.codelibs.fess.mylasta.direction.FessConfig fessConfig) For test purpose only.- Parameters:
fessConfig- fessConfig instance
-
register
Registers a component instance with a name.- Parameters:
instance- The component instance to register.name- The name to register the component under.
-