Class ProviderManager
java.lang.Object
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager
Manages resolve contexts for each resource provider including
authentication.
This class is not thread safe (same as the resource resolver).
-
Constructor Summary
ConstructorDescriptionProviderManager
(@NotNull ResourceResolver resolver, @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker) -
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticateAll
(@NotNull List<ResourceProviderHandler> handlers, @NotNull ResourceResolverControl control) Authenticate all handlersgetAllBestEffort
(@NotNull List<ResourceProviderHandler> handlers, @NotNull ResourceResolverControl control) @Nullable AuthenticatedResourceProvider
getOrCreateProvider
(@NotNull ResourceProviderHandler handler, @NotNull ResourceResolverControl control) Get the context@Nullable ResolveContext<Object>
getOrCreateResolveContext
(@NotNull ResourceProviderHandler handler, @NotNull ResourceResolverControl control) Get the context
-
Constructor Details
-
ProviderManager
public ProviderManager(@NotNull @NotNull ResourceResolver resolver, @NotNull @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker)
-
-
Method Details
-
getOrCreateProvider
@Nullable public @Nullable AuthenticatedResourceProvider getOrCreateProvider(@NotNull @NotNull ResourceProviderHandler handler, @NotNull @NotNull ResourceResolverControl control) throws LoginException Get the context- Parameters:
handler
- The resource handlercontrol
- The control- Returns:
- The resource context or
null
if authentication failed previously. - Throws:
LoginException
- If login fails
-
getOrCreateResolveContext
@Nullable public @Nullable ResolveContext<Object> getOrCreateResolveContext(@NotNull @NotNull ResourceProviderHandler handler, @NotNull @NotNull ResourceResolverControl control) throws LoginException Get the context- Parameters:
handler
- The resource handlercontrol
- The control- Returns:
- The resource context or
null
. - Throws:
LoginException
- If authentication fails to one provider
-
authenticateAll
public void authenticateAll(@NotNull @NotNull List<ResourceProviderHandler> handlers, @NotNull @NotNull ResourceResolverControl control) throws LoginException Authenticate all handlers- Parameters:
handlers
- List of handlerscontrol
- the resource resolver control- Throws:
LoginException
- If authentication fails to one provider
-
getAllAuthenticated
-
getAllUsedModifiable
-
getAllUsedRefreshable
-
getAllBestEffort
public Iterable<AuthenticatedResourceProvider> getAllBestEffort(@NotNull @NotNull List<ResourceProviderHandler> handlers, @NotNull @NotNull ResourceResolverControl control)
-