Interface AsConfigurationService

All Known Implementing Classes:
DefaultAsConfigurationService

public interface AsConfigurationService
Service that provides basic functionality for configurations.
Since:
6.7
  • Method Details

    • getConfigurationForUid

      <T extends AbstractAsConfigurationModel> Optional<T> getConfigurationForUid(Class<T> type, CatalogVersionModel catalogVersion, String uid)
      Returns the configuration for a specific type, catalog version and uid.
      Parameters:
      type - - the type
      catalogVersion - - the catalog version
      uid - - the unique identifier
      Returns:
      the configuration
    • refreshConfiguration

      void refreshConfiguration(AbstractAsConfigurationModel configuration)
      Requests the persistence to update the given configuration.
      Parameters:
      configuration - - the configuration
    • createConfiguration

      <T extends AbstractAsConfigurationModel> T createConfiguration(Class<T> type)
      Creates a new configuration. The new configuration remains not persisted.
      Parameters:
      type - - the type
      Returns:
      the configuration
    • cloneConfiguration

      <T extends AbstractAsConfigurationModel> T cloneConfiguration(T configuration)
      Clones the given configuration.
      Parameters:
      configuration - - the configuration to be cloned
      Returns:
      - the cloned version
    • saveConfiguration

      void saveConfiguration(AbstractAsConfigurationModel configuration)
      Saves the given configuration.
      Parameters:
      configuration - - the configuration
    • removeConfiguration

      void removeConfiguration(AbstractAsConfigurationModel configuration)
      Removes the given configuration.
      Parameters:
      configuration - - the configuration
    • isValid

      boolean isValid(AbstractAsConfigurationModel configuration)
      Checks whether the given configuration is valid.
      Parameters:
      configuration - - the configuration
      Returns:
      true if configuration is valid, false otherwise
    • moveConfiguration

      boolean moveConfiguration(AbstractAsConfigurationModel parentConfiguration, String sourceAttribute, String targetAttribute, String uid)
      Moves a configuration, all compatible attributes are copied. The given parent configuration will be updated and unsaved changes might be lost.
      Parameters:
      parentConfiguration - - the parent configuration
      sourceAttribute - - the source attribute
      targetAttribute - - the target attribute
      uid - - the the unique identifier
      Returns:
      true if the configuration was moved, false otherwise
      Throws:
      AttributeNotSupportedException - if sourceAttribute or targetAttribute do not exist on the given parentConfiguration or are not of type AbstractAsConfigurationModel
    • rankBeforeConfiguration

      List<AsRankChange> rankBeforeConfiguration(AbstractAsConfigurationModel parentConfiguration, String attribute, String rankBeforeUid, String... uids)
      Ranks multiple configurations before another one. If the given rankBeforeUid is blank the configuration is moved to the last position. The given parent configuration will be updated and unsaved changes might be lost.
      Parameters:
      parentConfiguration - - the parent configuration
      attribute - - the attribute
      rankBeforeUid - - the rank before unique identifier
      uids - - the the unique identifiers
      Returns:
      the rank changes
      Throws:
      AttributeNotSupportedException - if attribute does not exist on the given parentConfiguration or is not of type AbstractAsConfigurationModel
    • rankAfterConfiguration

      List<AsRankChange> rankAfterConfiguration(AbstractAsConfigurationModel parentConfiguration, String attribute, String rankAfterUid, String... uids)
      Ranks multiple configurations after another one. If the given rankAfterUid is blank the configuration is moved to the first position. The given parent configuration will be updated and unsaved changes might be lost.
      Parameters:
      parentConfiguration - - the parent configuration
      attribute - - the attribute
      rankAfterUid - - the rank before unique identifier
      uids - - the the unique identifiers
      Returns:
      the rank changes
      Throws:
      AttributeNotSupportedException - if attribute does not exist on the given parentConfiguration or is not of type AbstractAsConfigurationModel
    • rerankConfiguration

      AsRankChange rerankConfiguration(AbstractAsConfigurationModel parentConfiguration, String attribute, String uid, int change)
      Reranks a configuration. The given parent configuration will be updated and unsaved changes might be lost.
      Parameters:
      parentConfiguration - - the parent configuration
      attribute - - the attribute
      uid - - the the unique identifier
      change - - the change
      Returns:
      the rank change
      Throws:
      AttributeNotSupportedException - if attribute does not exist on the given parentConfiguration or is not of type AbstractAsConfigurationModel