Interface ResourceProviderFactory
-
@ConsumerType @Deprecated public interface ResourceProviderFactory
Deprecated.TheResourceProviderFactorydefines the service API to get and createResourceProviderss dynamically on a per usage base. Instead of sharing a resource provider between resource resolvers, the factory allows to create an own instance of a resource provider per resource resolver. The factory also supports authentication.If the resource provider is not used anymore and implements the
DynamicResourceProviderinterface, the close method should be called.- Since:
- 2.2.0 (Sling API Bundle 2.2.0)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_REQUIREDDeprecated.A required resource provider factory is accessed directly when a new resource resolver is created.static java.lang.StringSERVICE_BUNDLEDeprecated.The authentication information property referring to the bundle providing a service for which a resource provider is to be retrieved.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @NotNull ResourceProvidergetAdministrativeResourceProvider(java.util.Map<java.lang.String,java.lang.Object> authenticationInfo)Deprecated.as of 2.4 (bundle version 2.5.0) because of inherent security issues.@NotNull ResourceProvidergetResourceProvider(java.util.Map<java.lang.String,java.lang.Object> authenticationInfo)Deprecated.Returns a newResourceProviderinstance with further configuration taken from the givenauthenticationInfomap.
-
-
-
Field Detail
-
PROPERTY_REQUIRED
static final java.lang.String PROPERTY_REQUIRED
Deprecated.A required resource provider factory is accessed directly when a new resource resolver is created. Only if authentication against all required resource provider factories is successful, a resource resolver is created by the resource resolver factory. Boolean service property, default value isfalse.- See Also:
- Constant Field Values
-
SERVICE_BUNDLE
static final java.lang.String SERVICE_BUNDLE
Deprecated.The authentication information property referring to the bundle providing a service for which a resource provider is to be retrieved. If this property is provided, theResourceResolverFactory.SUBSERVICEproperty may also be present.ResourceResolverFactoryimplementations must provide this property if their implementation of theResourceResolverFactory.getServiceResourceResolver(Map)method use a resource provider factory.The type of this property, if present, is
org.osgi.framework.Bundle.- Since:
- 2.4 (Sling API Bundle 2.5.0)
- See Also:
- Constant Field Values
-
-
Method Detail
-
getResourceProvider
@NotNull @NotNull ResourceProvider getResourceProvider(java.util.Map<java.lang.String,java.lang.Object> authenticationInfo) throws LoginException
Deprecated.Returns a newResourceProviderinstance with further configuration taken from the givenauthenticationInfomap. Generally this map will contain a user name and password to authenticate.The
authenticationInfomap will in general contain the same information as provided to the respectiveResourceResolvermethod. ForIf the
authenticationInfomap isnulltheResourceProviderreturned will generally not be authenticated and only provide minimal privileges, if any at all.Implementations must ignore the
ResourceResolverFactory.USERproperty theSERVICE_BUNDLEproperty is provided to implement service authentication.The
ResourceResolverFactory.USER_IMPERSONATIONproperty is obeyed but requires that the actual user has permission to impersonate as the requested user. If such permission is missing, aLoginExceptionis thrown.- Parameters:
authenticationInfo- A map of further credential information which may be used by the implementation to parameterize how the resource provider is created. This may benull.- Returns:
- A
ResourceProvideraccording to theauthenticationInfo. - Throws:
LoginException- If an error occurs creating the newResourceProviderwith the provided credential data.- See Also:
- Service Authentication
-
getAdministrativeResourceProvider
@Deprecated @NotNull @NotNull ResourceProvider getAdministrativeResourceProvider(java.util.Map<java.lang.String,java.lang.Object> authenticationInfo) throws LoginException
Deprecated.as of 2.4 (bundle version 2.5.0) because of inherent security issues. Implementations may implement this method at their discretion but must support the new service based resource provider generation in thegetResourceProvider(Map)method honoring theSERVICE_BUNDLEandResourceResolverFactory.SUBSERVICEproperties.Returns a newResourceProviderinstance with administrative privileges with further configuration taken from the givenauthenticationInfomap.Note, that if the
authenticationInfomap contains theResourceResolverFactory.USER_IMPERSONATIONattribute theResourceProviderreturned will only have administrative privileges if the user identified by the property has administrative privileges.Implementations of this method should throw
LoginExceptionif they don't support it.- Parameters:
authenticationInfo- A map of further credential information which may be used by the implementation to parameterize how the resource provider is created. This may benull.- Returns:
- A
ResourceProviderwith administrative privileges unless theResourceResolverFactory.USER_IMPERSONATIONwas set in theauthenticationInfo. - Throws:
LoginException- If an error occurs creating the newResourceResolverFactorywith the provided credential data.
-
-