Interface AsConfigurationService

  • All Known Implementing Classes:
    DefaultAsConfigurationService

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

      • getConfigurationForUid

        <T extends AbstractAsConfigurationModel> java.util.Optional<T> getConfigurationForUid​(java.lang.Class<T> type,
                                                                                              CatalogVersionModel catalogVersion,
                                                                                              java.lang.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​(java.lang.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,
                                  java.lang.String sourceAttribute,
                                  java.lang.String targetAttribute,
                                  java.lang.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

        java.util.List<AsRankChange> rankBeforeConfiguration​(AbstractAsConfigurationModel parentConfiguration,
                                                             java.lang.String attribute,
                                                             java.lang.String rankBeforeUid,
                                                             java.lang.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

        java.util.List<AsRankChange> rankAfterConfiguration​(AbstractAsConfigurationModel parentConfiguration,
                                                            java.lang.String attribute,
                                                            java.lang.String rankAfterUid,
                                                            java.lang.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,
                                         java.lang.String attribute,
                                         java.lang.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