
org.apache.sling.api.resource.AttributableResourceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.sling.api Show documentation
Show all versions of org.apache.sling.api Show documentation
The Apache Sling API defines an extension to the Servlet
API 2.4 to provide access to content and unified access
to request parameters hiding the differences between the
different methods of transferring parameters from client
to server. Note that the Apache Sling API bundle does not
include the Servlet API but instead requires the API to
be provided by the Servlet container in which the Apache
Sling framework is running or by another bundle.
/*
* 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.api.resource;
import java.util.Collection;
import org.osgi.annotation.versioning.ConsumerType;
/**
* The attributes provider is an extensions of a {@link ResourceProvider}.
* It allows to add attributes to the set of available attributes from a
* resource resolver.
*
* This extension is supported for services directly implementing the
* {@link ResourceProvider} interface and {@link ResourceProvider}s
* returned through a {@link ResourceProviderFactory}.
*
* @see ResourceResolver#getAttribute(String)
* @see ResourceResolver#getAttributeNames()
*
* @since 2.2 (Sling API Bundle 2.2.0)
* @deprecated Use the {@link org.apache.sling.spi.resource.provider.ResourceProvider}
*/
@Deprecated
@ConsumerType
public interface AttributableResourceProvider extends ResourceProvider {
/**
* Returns a collection of attribute names whose value can be retrieved
* calling the {@link #getAttribute(ResourceResolver, String)} method.
*
* @param resolver The resource resolver
* @return A collection of attribute names or null
* @throws IllegalStateException if this resource provider has already been
* closed.
*/
Collection getAttributeNames(ResourceResolver resolver);
/**
* Returns the value of the given resource provider attribute or null
* if the attribute is not set or not visible (as e.g. security
* sensitive attributes).
*
* @param resolver The resource resolver
* @param name
* The name of the attribute to access
* @return The value of the attribute or null
if the attribute
* is not set or not accessible.
* @throws NullPointerException
* if name
is null
.
* @throws IllegalStateException
* if this resource provider has already been closed.
*/
Object getAttribute(ResourceResolver resolver, String name);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy