Interface AsConfigurationService
- All Known Implementing Classes:
DefaultAsConfigurationService
public interface AsConfigurationService
Service that provides basic functionality for configurations.
- Since:
- 6.7
-
Method Summary
Modifier and TypeMethodDescription<T extends AbstractAsConfigurationModel>
TcloneConfiguration(T configuration) Clones the given configuration.<T extends AbstractAsConfigurationModel>
TcreateConfiguration(Class<T> type) Creates a new configuration.<T extends AbstractAsConfigurationModel>
Optional<T>getConfigurationForUid(Class<T> type, CatalogVersionModel catalogVersion, String uid) Returns the configuration for a specific type, catalog version and uid.booleanisValid(AbstractAsConfigurationModel configuration) Checks whether the given configuration is valid.booleanmoveConfiguration(AbstractAsConfigurationModel parentConfiguration, String sourceAttribute, String targetAttribute, String uid) Moves a configuration, all compatible attributes are copied.rankAfterConfiguration(AbstractAsConfigurationModel parentConfiguration, String attribute, String rankAfterUid, String... uids) Ranks multiple configurations after another one.rankBeforeConfiguration(AbstractAsConfigurationModel parentConfiguration, String attribute, String rankBeforeUid, String... uids) Ranks multiple configurations before another one.voidrefreshConfiguration(AbstractAsConfigurationModel configuration) Requests the persistence to update the given configuration.voidremoveConfiguration(AbstractAsConfigurationModel configuration) Removes the given configuration.rerankConfiguration(AbstractAsConfigurationModel parentConfiguration, String attribute, String uid, int change) Reranks a configuration.voidsaveConfiguration(AbstractAsConfigurationModel configuration) Saves the given configuration.
-
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 typecatalogVersion- - the catalog versionuid- - the unique identifier- Returns:
- the configuration
-
refreshConfiguration
Requests the persistence to update the given configuration.- Parameters:
configuration- - the configuration
-
createConfiguration
Creates a new configuration. The new configuration remains not persisted.- Parameters:
type- - the type- Returns:
- the configuration
-
cloneConfiguration
Clones the given configuration.- Parameters:
configuration- - the configuration to be cloned- Returns:
- - the cloned version
-
saveConfiguration
Saves the given configuration.- Parameters:
configuration- - the configuration
-
removeConfiguration
Removes the given configuration.- Parameters:
configuration- - the configuration
-
isValid
Checks whether the given configuration is valid.- Parameters:
configuration- - the configuration- Returns:
trueif configuration is valid,falseotherwise
-
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 configurationsourceAttribute- - the source attributetargetAttribute- - the target attributeuid- - the the unique identifier- Returns:
trueif the configuration was moved,falseotherwise- Throws:
AttributeNotSupportedException- if sourceAttribute or targetAttribute do not exist on the given parentConfiguration or are not of typeAbstractAsConfigurationModel
-
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 configurationattribute- - the attributerankBeforeUid- - the rank before unique identifieruids- - the the unique identifiers- Returns:
- the rank changes
- Throws:
AttributeNotSupportedException- if attribute does not exist on the given parentConfiguration or is not of typeAbstractAsConfigurationModel
-
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 configurationattribute- - the attributerankAfterUid- - the rank before unique identifieruids- - the the unique identifiers- Returns:
- the rank changes
- Throws:
AttributeNotSupportedException- if attribute does not exist on the given parentConfiguration or is not of typeAbstractAsConfigurationModel
-
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 configurationattribute- - the attributeuid- - the the unique identifierchange- - the change- Returns:
- the rank change
- Throws:
AttributeNotSupportedException- if attribute does not exist on the given parentConfiguration or is not of typeAbstractAsConfigurationModel
-