Package org.apache.sling.resourceresolver.impl.providers.stateful

# Class ProviderManager

java.lang.Object
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager

public class ProviderManager extends Object
Manages resolve contexts for each resource provider including authentication. This class is not thread safe (same as the resource resolver).

## Constructor Summary

Constructors
Constructor
Description
`ProviderManager(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker)`

## Method Summary

Modifier and Type
Method
Description
`void`
`authenticateAll(@NotNull List<ResourceProviderHandler> handlers, @NotNull ResourceResolverControl control)`
Authenticate all handlers
`Collection<AuthenticatedResourceProvider>`
`getAllAuthenticated()`
`Iterable<AuthenticatedResourceProvider>`
`getAllBestEffort(@NotNull List<ResourceProviderHandler> handlers, @NotNull ResourceResolverControl control)`
`Collection<AuthenticatedResourceProvider>`
`getAllUsedModifiable()`
`Collection<AuthenticatedResourceProvider>`
`getAllUsedRefreshable()`
`@Nullable AuthenticatedResourceProvider`
`getOrCreateProvider(@NotNull ResourceProviderHandler handler, @NotNull ResourceResolverControl control)`
Get the context
`@Nullable org.apache.sling.spi.resource.provider.ResolveContext<Object>`
`getOrCreateResolveContext(@NotNull ResourceProviderHandler handler, @NotNull ResourceResolverControl control)`
Get the context

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ProviderManager

public ProviderManager(@NotNull @NotNull org.apache.sling.api.resource.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 org.apache.sling.api.resource.LoginException
Get the context

Parameters:
  `handler` - The resource handler
  `control` - The control
Returns:
  The resource context or `null` if authentication failed previously.
Throws:
  `org.apache.sling.api.resource.LoginException` - If login fails

### getOrCreateResolveContext

@Nullable public @Nullable org.apache.sling.spi.resource.provider.ResolveContext<Object> getOrCreateResolveContext(@NotNull @NotNull ResourceProviderHandler handler, @NotNull @NotNull ResourceResolverControl control) throws org.apache.sling.api.resource.LoginException
Get the context

Parameters:
  `handler` - The resource handler
  `control` - The control
Returns:
  The resource context or `null`.
Throws:
  `org.apache.sling.api.resource.LoginException` - If authentication fails to one provider

### authenticateAll

public void authenticateAll(@NotNull @NotNull List<ResourceProviderHandler> handlers, @NotNull @NotNull ResourceResolverControl control) throws org.apache.sling.api.resource.LoginException
Authenticate all handlers

Parameters:
  `handlers` - List of handlers
  `control` - the resource resolver control
Throws:
  `org.apache.sling.api.resource.LoginException` - If authentication fails to one provider

### getAllAuthenticated

public Collection<AuthenticatedResourceProvider> getAllAuthenticated()

### getAllUsedModifiable

public Collection<AuthenticatedResourceProvider> getAllUsedModifiable()

### getAllUsedRefreshable

public Collection<AuthenticatedResourceProvider> getAllUsedRefreshable()

### getAllBestEffort

public Iterable<AuthenticatedResourceProvider> getAllBestEffort(@NotNull @NotNull List<ResourceProviderHandler> handlers, @NotNull @NotNull ResourceResolverControl control)