Class DataConfigService

java.lang.Object
org.codelibs.fess.app.service.FessAppService
org.codelibs.fess.app.service.DataConfigService

public class DataConfigService extends FessAppService
Service class for managing data configuration CRUD operations. This service provides functionality to create, read, update, and delete data configurations used by the Fess crawler system.

Data configurations define how the crawler should access and process various data sources such as databases, CSV files, or other structured data.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.codelibs.fess.opensearch.config.exbhv.DataConfigBhv
    DBFlute behavior for data configuration operations.
    protected org.codelibs.fess.mylasta.direction.FessConfig
    Fess configuration containing application settings.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of DataConfigService.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(org.codelibs.fess.opensearch.config.exentity.DataConfig dataConfig)
    Deletes the specified data configuration from the system.
    org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.config.exentity.DataConfig>
    Retrieves a data configuration by its unique identifier.
    org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.config.exentity.DataConfig>
    Retrieves a data configuration by its name.
    List<org.codelibs.fess.opensearch.config.exentity.DataConfig>
    Retrieves a paginated list of data configurations based on search criteria.
    protected void
    setupListCondition(org.codelibs.fess.opensearch.config.cbean.DataConfigCB cb, DataConfigPager dataConfigPager)
    Sets up the search conditions for listing data configurations.
    void
    store(org.codelibs.fess.opensearch.config.exentity.DataConfig dataConfig)
    Stores (inserts or updates) a data configuration.

    Methods inherited from class org.codelibs.fess.app.service.FessAppService

    wrapQuery

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dataConfigBhv

      protected org.codelibs.fess.opensearch.config.exbhv.DataConfigBhv dataConfigBhv
      DBFlute behavior for data configuration operations. Provides database access methods for DataConfig entities.
    • fessConfig

      protected org.codelibs.fess.mylasta.direction.FessConfig fessConfig
      Fess configuration containing application settings. Used to retrieve paging and other configuration parameters.
  • Constructor Details

    • DataConfigService

      public DataConfigService()
      Creates a new instance of DataConfigService. This constructor initializes the service for managing data configuration operations including CRUD operations and search functionality.
  • Method Details

    • getDataConfigList

      public List<org.codelibs.fess.opensearch.config.exentity.DataConfig> getDataConfigList(DataConfigPager dataConfigPager)
      Retrieves a paginated list of data configurations based on search criteria.

      This method performs a paginated search through all data configurations, applying any search filters specified in the pager. The results are sorted by sort order and name.

      Parameters:
      dataConfigPager - the pager containing search criteria and pagination settings
      Returns:
      a list of DataConfig entities matching the search criteria
      Throws:
      IllegalArgumentException - if dataConfigPager is null
    • delete

      public void delete(org.codelibs.fess.opensearch.config.exentity.DataConfig dataConfig)
      Deletes the specified data configuration from the system.

      This operation permanently removes the data configuration and immediately refreshes the index to ensure the change is visible.

      Parameters:
      dataConfig - the data configuration to delete
      Throws:
      IllegalArgumentException - if dataConfig is null
      org.dbflute.exception.EntityAlreadyDeletedException - if the entity has already been deleted
    • getDataConfig

      public org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.config.exentity.DataConfig> getDataConfig(String id)
      Retrieves a data configuration by its unique identifier.
      Parameters:
      id - the unique identifier of the data configuration
      Returns:
      an OptionalEntity containing the DataConfig if found, empty otherwise
      Throws:
      IllegalArgumentException - if id is null or empty
    • getDataConfigByName

      public org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.config.exentity.DataConfig> getDataConfigByName(String name)
      Retrieves a data configuration by its name.

      If multiple configurations exist with the same name, returns the first one ordered by sort order ascending.

      Parameters:
      name - the name of the data configuration to retrieve
      Returns:
      an OptionalEntity containing the DataConfig if found, empty otherwise
      Throws:
      IllegalArgumentException - if name is null or empty
    • store

      public void store(org.codelibs.fess.opensearch.config.exentity.DataConfig dataConfig)
      Stores (inserts or updates) a data configuration.

      This method encrypts sensitive handler parameters before storing and immediately refreshes the index to ensure the change is visible. If the configuration already exists (based on ID), it will be updated; otherwise, a new configuration will be created.

      Parameters:
      dataConfig - the data configuration to store
      Throws:
      IllegalArgumentException - if dataConfig is null
    • setupListCondition

      protected void setupListCondition(org.codelibs.fess.opensearch.config.cbean.DataConfigCB cb, DataConfigPager dataConfigPager)
      Sets up the search conditions for listing data configurations.

      This method configures the condition bean with search criteria from the pager, including name wildcards, handler name wildcards, and description matching. Results are ordered by sort order and name in ascending order.

      Description matching supports:

      • Wildcard matching (if starts or ends with *)
      • Prefix matching (if ends with *)
      • Exact phrase matching (otherwise)
      Parameters:
      cb - the condition bean to configure
      dataConfigPager - the pager containing search criteria