blob: 75ff5c0087513c7a2f3ed9a95d0f1e6f08661cb0 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
package org.apache.sling.caconfig.management;
import java.util.Set;
import org.apache.sling.api.resource.ValueMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.osgi.annotation.versioning.ProviderType;
/**
* Provides access to the configuration data and metadata for a given context path.
*/
@ProviderType
public interface ConfigurationData {
/**
* Get configuration name.
* @return Configuration name
*/
@NotNull String getConfigName();
/**
* In case of configuration resource collection, this returns the collection item resource name.
* @return Item resource name or null if it is a singleton resource.
*/
@Nullable String getCollectionItemName();
/**
* @return Path of the configuration resource or null if it cannot be determined.
*/
@Nullable String getResourcePath();
/**
* List of effective property names defined in configuration metadata or values are defined for.
* @return Property names
*/
@NotNull Set<String> getPropertyNames();
/**
* Configuration values stored for the given context path. No inherited values. No default values.
* The properties of the resource identified by {@link #getResourcePath()} are returned.
* If this resources does not exist, the map is empty.
* @return Values
*/
@NotNull ValueMap getValues();
/**
* Configuration values stored for the given context path merged with inherited values and default values.
* @return Values
*/
@NotNull ValueMap getEffectiveValues();
/**
* Get detailed metadata information about the property value.
* @param propertyName Property name
* @return Value information. Null if neither property metadata nor an existing value exists.
*/
@Nullable ValueInfo<?> getValueInfo(String propertyName);
/**
* @return true if the whole configuration is inherited.
*/
boolean isInherited();
/**
* @return true if the whole configuration is overridden by an configuration override provider.
*/
boolean isOverridden();
}