io.wcm.config.spi.ParameterOverrideProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of io.wcm.config.api Show documentation
Show all versions of io.wcm.config.api Show documentation
API and SPI for context-specific configuration.
/*
* #%L
* wcm.io
* %%
* Copyright (C) 2014 wcm.io
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package io.wcm.config.spi;
import java.util.Map;
import org.osgi.annotation.versioning.ConsumerType;
/**
* Provides configuration override values (default or forced).
*/
@ConsumerType
public interface ParameterOverrideProvider {
/**
* Returns a map with key value pairs for configuration parameter override.
*
* Key:
*
*
* - Syntax:
[{scope}[:locked]]{parameterName}
* {scope}
: if "default", the system default parameter is overriden. Otherwise {scope}
* may define a configuration id (path), in this case the configuration parameter is overwritten by force for this
* configuration level. If the [{scope}] part is missing or [locked], the parameter is overridded for all
* configurations.
* locked
: If the scope value is suffixed with the string ":locked" this configuration
* parameter cannot be overridden in nested configuration scopes.
* {parameterName}
: Parameter name (from parameter definitions)
*
*
* Examples:
*
*
* [default]param1
- Override default value for parameter "param1"
* param1
- Override value for parameter "param1" for all configurations
* [/content/region1/site1]param1
- Override value for parameter "param1" for the configurations at
* /content/region1/site1
. This has higher precedence than the other variants.
*
*
* Value:
*
*
* - Override value
* - Has to be convertible to the parameter's type
*
* @return Map (never null)
*/
Map getOverrideMap();
}