Package org.apache.sling.jackrabbit.usermanager.impl.resource

# Class AuthorizableResourceProvider

java.lang.Object
org.apache.sling.spi.resource.provider.ResourceProvider<Object>
org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider

All Implemented Interfaces:
  `SystemUserManagerPaths`

public class AuthorizableResourceProvider extends org.apache.sling.spi.resource.provider.ResourceProvider<Object> implements SystemUserManagerPaths
Resource Provider implementation for jackrabbit UserManager resources.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected static interface`
`AuthorizableResourceProvider.AuthorizableWorker<T>`
Interface for lambda expressions to do work on a resolved authorizable + optional relative path
`static @interface`
`AuthorizableResourceProvider.Config`
`protected static interface`
`AuthorizableResourceProvider.PrincipalWorker<T>`
Interface for lambda expressions to do work on a resolved principal

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_SYSTEM_USER_MANAGER_PATH`

### Fields inherited from class org.apache.sling.spi.resource.provider.ResourceProvider

`AUTH_ADMIN, AUTH_CLONE, AUTH_SERVICE_BUNDLE, AUTHENTICATE_LAZY, AUTHENTICATE_NO, AUTHENTICATE_REQUIRED, MODE_OVERLAY, MODE_PASSTHROUGH, PROPERTY_ADAPTABLE, PROPERTY_ATTRIBUTABLE, PROPERTY_AUTHENTICATE, PROPERTY_MODE, PROPERTY_MODIFIABLE, PROPERTY_NAME, PROPERTY_REFRESHABLE, PROPERTY_ROOT, PROPERTY_USE_RESOURCE_ACCESS_SECURITY, RESOURCE_TYPE_SYNTHETIC`

## Constructor Summary

Constructors
Constructor
Description
`AuthorizableResourceProvider()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`activate(AuthorizableResourceProvider.Config config)`
`protected List<org.apache.sling.api.resource.Resource>`
`filterPropertyContainers(String relPath, org.apache.jackrabbit.api.security.user.Authorizable authorizable, org.apache.sling.api.resource.Resource r)`
Filter the resource children to return only the resources that are nested property containers
`String`
`getGroupPrefix()`
The path prefix (before the id) for groups
`String`
`getGroupsPath()`
The root path for all group resources
`protected static Iterator<String>`
`getPropertyNames(String relPath, org.apache.jackrabbit.api.security.user.Authorizable authorizable)`
`org.apache.sling.api.resource.Resource`
`getResource(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, String path, org.apache.sling.spi.resource.provider.ResourceContext resourceContext, org.apache.sling.api.resource.Resource parent)`
`String`
`getRootPath()`
The root path for usermanager resources
`String`
`getUserPrefix()`
The path prefix (before the id) for users
`String`
`getUsersPath()`
The root path for all user resources
`Iterator<org.apache.sling.api.resource.Resource>`
`listChildren(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, org.apache.sling.api.resource.Resource parent)`
`protected <T> T`
`maybeDoAuthorizableWork(@NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, @NotNull String path, @NotNull AuthorizableResourceProvider.AuthorizableWorker<T> authorizableWorker, @Nullable AuthorizableResourceProvider.PrincipalWorker<T> principalWorker)`
If the path resolves to a user or group (with optional relPath suffix) then invoke the worker to do some work.

### Methods inherited from class org.apache.sling.spi.resource.provider.ResourceProvider

`adaptTo, authenticate, commit, copy, create, delete, getAttribute, getAttributeNames, getParent, getProviderContext, getQueryLanguageProvider, hasChanges, isLive, logout, move, orderBefore, refresh, revert, start, stop, update`

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

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

## Field Details

### DEFAULT_SYSTEM_USER_MANAGER_PATH

public static final String DEFAULT_SYSTEM_USER_MANAGER_PATH

See Also:
  - Constant Field Values

## Constructor Details

### AuthorizableResourceProvider

public AuthorizableResourceProvider()

## Method Details

### activate

protected void activate(AuthorizableResourceProvider.Config config)

### getRootPath

public String getRootPath()
Description copied from interface: `SystemUserManagerPaths`
The root path for usermanager resources

Specified by:
  `getRootPath` in interface `SystemUserManagerPaths`

### getUsersPath

public String getUsersPath()
Description copied from interface: `SystemUserManagerPaths`
The root path for all user resources

Specified by:
  `getUsersPath` in interface `SystemUserManagerPaths`

### getUserPrefix

public String getUserPrefix()
Description copied from interface: `SystemUserManagerPaths`
The path prefix (before the id) for users

Specified by:
  `getUserPrefix` in interface `SystemUserManagerPaths`

### getGroupsPath

public String getGroupsPath()
Description copied from interface: `SystemUserManagerPaths`
The root path for all group resources

Specified by:
  `getGroupsPath` in interface `SystemUserManagerPaths`

### getGroupPrefix

public String getGroupPrefix()
Description copied from interface: `SystemUserManagerPaths`
The path prefix (before the id) for groups

Specified by:
  `getGroupPrefix` in interface `SystemUserManagerPaths`

### getResource

public org.apache.sling.api.resource.Resource getResource(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, String path, org.apache.sling.spi.resource.provider.ResourceContext resourceContext, org.apache.sling.api.resource.Resource parent)

Specified by:
  `getResource` in class `org.apache.sling.spi.resource.provider.ResourceProvider<Object>`

### maybeDoAuthorizableWork

protected <T> T maybeDoAuthorizableWork(@NotNull @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, @NotNull @NotNull String path, @NotNull @NotNull AuthorizableResourceProvider.AuthorizableWorker<T> authorizableWorker, @Nullable @Nullable AuthorizableResourceProvider.PrincipalWorker<T> principalWorker)
If the path resolves to a user or group (with optional relPath suffix) then invoke the worker to do some work.

### getPropertyNames

protected static Iterator<String> getPropertyNames(String relPath, org.apache.jackrabbit.api.security.user.Authorizable authorizable)

### listChildren

public Iterator<org.apache.sling.api.resource.Resource> listChildren(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, org.apache.sling.api.resource.Resource parent)

Specified by:
  `listChildren` in class `org.apache.sling.spi.resource.provider.ResourceProvider<Object>`

### filterPropertyContainers

protected List<org.apache.sling.api.resource.Resource> filterPropertyContainers(String relPath, org.apache.jackrabbit.api.security.user.Authorizable authorizable, org.apache.sling.api.resource.Resource r)
Filter the resource children to return only the resources that are nested property containers

Parameters:
  `relPath` - the relative path to start from
  `authorizable` - the user or group
  `r` - the resource to filter the children of
Returns:
  list of resources that are property containers