Class ComponentUtil

java.lang.Object
org.codelibs.fess.util.ComponentUtil

public final class ComponentUtil extends Object
Utility class for accessing system components and dependencies. Provides centralized access to various helpers, managers, and services throughout the Fess application.
  • Method Details

    • processAfterContainerInit

      public static void processAfterContainerInit(Runnable process)
      Processes a runnable after container initialization.
      Parameters:
      process - The process to run after container init.
    • doInitProcesses

      public static void doInitProcesses(Consumer<? super Runnable> action)
      Executes all initialization processes.
      Parameters:
      action - The action to perform on each initialization process.
    • getCipher

      public static org.codelibs.core.crypto.CachedCipher getCipher(String cipherName)
      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

      public static SystemHelper getSystemHelper()
      Gets the system helper component.
      Returns:
      The system helper.
    • getViewHelper

      public static ViewHelper getViewHelper()
      Gets the view helper component.
      Returns:
      The view helper.
    • getSambaHelper

      public static SambaHelper getSambaHelper()
      Gets the Samba helper component.
      Returns:
      The Samba helper.
    • getQueryHelper

      public static QueryHelper getQueryHelper()
      Gets the query helper component.
      Returns:
      The query helper.
    • getQueryFieldConfig

      public static QueryFieldConfig getQueryFieldConfig()
      Gets the query field configuration.
      Returns:
      The query field config.
    • getQueryProcessor

      public static QueryProcessor getQueryProcessor()
      Gets the query processor component.
      Returns:
      The query processor.
    • getLabelTypeHelper

      public static LabelTypeHelper getLabelTypeHelper()
      Gets the label type helper component.
      Returns:
      The label type helper.
    • getSearchLogHelper

      public static SearchLogHelper getSearchLogHelper()
      Gets the search log helper component.
      Returns:
      The search log helper.
    • getCrawlingConfigHelper

      public static CrawlingConfigHelper getCrawlingConfigHelper()
      Gets the crawling configuration helper component.
      Returns:
      The crawling config helper.
    • getCrawlingInfoHelper

      public static CrawlingInfoHelper getCrawlingInfoHelper()
      Gets the crawling info helper component.
      Returns:
      The crawling info helper.
    • getPopularWordHelper

      public static PopularWordHelper getPopularWordHelper()
      Gets the popular word helper component.
      Returns:
      The popular word helper.
    • getPathMappingHelper

      public static PathMappingHelper getPathMappingHelper()
      Gets the path mapping helper component.
      Returns:
      The path mapping helper.
    • getDuplicateHostHelper

      public static DuplicateHostHelper getDuplicateHostHelper()
      Gets the duplicate host helper component.
      Returns:
      The duplicate host helper.
    • getProcessHelper

      public static ProcessHelper getProcessHelper()
      Gets the process helper component.
      Returns:
      The process helper.
    • getJobHelper

      public static JobHelper getJobHelper()
      Gets the job helper component.
      Returns:
      The job helper.
    • getWebApiManagerFactory

      public static WebApiManagerFactory getWebApiManagerFactory()
      Gets the web API manager factory component.
      Returns:
      The web API manager factory.
    • getUserAgentHelper

      public static UserAgentHelper getUserAgentHelper()
      Gets the user agent helper component.
      Returns:
      The user agent helper.
    • getDataStoreFactory

      public static DataStoreFactory getDataStoreFactory()
      Gets the data store factory component.
      Returns:
      The data store factory.
    • getIntervalControlHelper

      public static IntervalControlHelper 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

      public static JobExecutor getJobExecutor(String name)
      Gets a job executor by name.
      Parameters:
      name - The name of the job executor.
      Returns:
      The job executor instance.
    • getFileTypeHelper

      public static FileTypeHelper getFileTypeHelper()
      Gets the file type helper component.
      Returns:
      The file type helper.
    • getIndexUpdater

      public static IndexUpdater getIndexUpdater()
      Gets the index updater component.
      Returns:
      The index updater.
    • getKeyMatchHelper

      public static KeyMatchHelper getKeyMatchHelper()
      Gets the key match helper component.
      Returns:
      The key match helper.
    • getIndexingHelper

      public static IndexingHelper getIndexingHelper()
      Gets the indexing helper component.
      Returns:
      The indexing helper.
    • getUserInfoHelper

      public static UserInfoHelper 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

      public static DictionaryManager 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

      public static SearchEngineClient 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

      public static SuggestHelper getSuggestHelper()
      Gets the suggest helper component.
      Returns:
      The suggest helper.
    • getRoleQueryHelper

      public static RoleQueryHelper getRoleQueryHelper()
      Gets the role query helper component.
      Returns:
      The role query helper.
    • getLdapManager

      public static LdapManager getLdapManager()
      Gets the LDAP manager component.
      Returns:
      The LDAP manager.
    • getActivityHelper

      public static ActivityHelper 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

      public static DocumentHelper getDocumentHelper()
      Gets the document helper component.
      Returns:
      The document helper.
    • getQueryParser

      public static QueryParser getQueryParser()
      Gets the query parser component.
      Returns:
      The query parser.
    • getPermissionHelper

      public static PermissionHelper getPermissionHelper()
      Gets the permission helper component.
      Returns:
      The permission helper.
    • getPasswordHashHelper

      public static PasswordHashHelper getPasswordHashHelper()
      Gets the password hash helper component.
      Returns:
      The password hash helper.
    • getSsoManager

      public static SsoManager getSsoManager()
      Gets the SSO manager component.
      Returns:
      The SSO manager.
    • getThumbnailManager

      public static ThumbnailManager getThumbnailManager()
      Gets the thumbnail manager component.
      Returns:
      The thumbnail manager.
    • getAuthenticationManager

      public static AuthenticationManager 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

      public static RelatedQueryHelper getRelatedQueryHelper()
      Gets the related query helper component.
      Returns:
      The related query helper.
    • getRelatedContentHelper

      public static RelatedContentHelper getRelatedContentHelper()
      Gets the related content helper component.
      Returns:
      The related content helper.
    • getVirtualHostHelper

      public static VirtualHostHelper getVirtualHostHelper()
      Gets the virtual host helper component.
      Returns:
      The virtual host helper.
    • getAccessTokenHelper

      public static AccessTokenHelper getAccessTokenHelper()
      Gets the access token helper component.
      Returns:
      The access token helper.
    • getRateLimitHelper

      public static RateLimitHelper getRateLimitHelper()
      Gets the rate limit helper component.
      Returns:
      The rate limit helper.
    • getLoginRateLimiter

      public static LoginRateLimiter getLoginRateLimiter()
      Gets the v2 login rate limiter component.
      Returns:
      The login rate limiter (shared singleton).
    • getSessionCsrfTokenManager

      public static SessionCsrfTokenManager getSessionCsrfTokenManager()
      Gets the session-scoped CSRF token manager component used by the v2 API.
      Returns:
      The session CSRF token manager (shared singleton).
    • getV2EnvelopeWriter

      public static V2EnvelopeWriter getV2EnvelopeWriter()
      Gets the v2 envelope writer component.
      Returns:
      The v2 envelope writer.
    • getV2JsonBody

      public static V2JsonBody getV2JsonBody()
      Gets the v2 JSON body reader component.
      Returns:
      The v2 JSON body reader.
    • getV2UserPayloads

      public static UserPayloads getV2UserPayloads()
      Gets the v2 user payload builder component.
      Returns:
      The v2 user payload builder.
    • getV2CsrfRequirement

      public static CsrfRequirement getV2CsrfRequirement()
      Gets the v2 CSRF requirement component.
      Returns:
      The v2 CSRF requirement component.
    • getV2DocIdValidator

      public static DocIdValidator getV2DocIdValidator()
      Gets the v2 document id validator component.
      Returns:
      The v2 document id validator.
    • getSseResponseHelper

      public static SseResponseHelper getSseResponseHelper()
      Gets the SSE response helper component.
      Returns:
      The SSE response helper.
    • getThemeRegistry

      public static ThemeRegistry getThemeRegistry()
      Gets the theme registry component.
      Returns:
      The theme registry (shared singleton).
    • getStaticThemeResponder

      public static StaticThemeResponder getStaticThemeResponder()
      Gets the static theme responder component.
      Returns:
      The static theme responder (shared singleton).
    • getStaticThemeInstaller

      public static StaticThemeInstaller getStaticThemeInstaller()
      Gets the static theme installer component.
      Returns:
      The static theme installer (shared singleton).
    • getQueryStringBuilder

      public static QueryStringBuilder getQueryStringBuilder()
      Gets the query string builder component.
      Returns:
      The query string builder.
    • getCurlHelper

      public static CurlHelper getCurlHelper()
      Gets the curl helper component.
      Returns:
      The curl helper.
    • getCoordinatorHelper

      public static CoordinatorHelper getCoordinatorHelper()
      Gets the coordinator helper component.
      Returns:
      The coordinator helper.
    • getLanguageHelper

      public static LanguageHelper getLanguageHelper()
      Gets the language helper component.
      Returns:
      The language helper.
    • getPluginHelper

      public static PluginHelper getPluginHelper()
      Gets the plugin helper component.
      Returns:
      The plugin helper.
    • getThemeHelper

      public static ThemeHelper getThemeHelper()
      Gets the theme helper component.
      Returns:
      The theme helper.
    • getSearchHelper

      public static SearchHelper getSearchHelper()
      Gets the search helper component.
      Returns:
      The search helper.
    • getNotificationHelper

      public static NotificationHelper getNotificationHelper()
      Gets the notification helper component.
      Returns:
      The notification helper.
    • getLogNotificationHelper

      public static LogNotificationHelper getLogNotificationHelper()
      Gets the log notification helper component.
      Returns:
      The log notification helper.
    • getIngestFactory

      public static IngestFactory getIngestFactory()
      Gets the ingest factory component.
      Returns:
      The ingest factory.
    • getScriptEngineFactory

      public static ScriptEngineFactory getScriptEngineFactory()
      Gets the script engine factory component.
      Returns:
      The script engine factory.
    • getCrawlerStatsHelper

      public static CrawlerStatsHelper getCrawlerStatsHelper()
      Gets the crawler stats helper component.
      Returns:
      The crawler stats helper.
    • getCorsHandlerFactory

      public static CorsHandlerFactory getCorsHandlerFactory()
      Gets the CORS handler factory component.
      Returns:
      The CORS handler factory.
    • getRankFusionProcessor

      public static RankFusionProcessor getRankFusionProcessor()
      Gets the rank fusion processor component.
      Returns:
      The rank fusion processor.
    • getProtocolHelper

      public static ProtocolHelper getProtocolHelper()
      Gets the protocol helper component.
      Returns:
      The protocol helper.
    • getChatSessionManager

      public static ChatSessionManager getChatSessionManager()
      Gets the chat session manager component.
      Returns:
      The chat session manager.
    • getChatApiHelper

      public static ChatApiHelper getChatApiHelper()
      Gets the chat API helper component.
      Returns:
      The chat API helper.
    • getChatClient

      public static ChatClient getChatClient()
      Gets the chat client component.
      Returns:
      The chat client.
    • getChatContentFetcher

      public static ChatContentFetcher getChatContentFetcher()
      Gets the chat content fetcher component.
      Returns:
      the chat content fetcher
    • getMarkdownRenderer

      public static MarkdownRenderer getMarkdownRenderer()
      Gets the markdown renderer component.
      Returns:
      The markdown renderer.
    • getComponent

      public static <T> T getComponent(Class<T> clazz)
      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

      public static <T> T getComponent(String componentName)
      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

      public static boolean hasComponent(String componentKey)
      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 avoid ComponentNotFoundException or NullPointerException from getRequestManager().
      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

      public static void register(Object instance, String name)
      Registers a component instance with a name.
      Parameters:
      instance - The component instance to register.
      name - The name to register the component under.