Package org.apache.sling.testing.mock.jcr

# Klasse MockUserManager

java.lang.Object
org.apache.sling.testing.mock.jcr.MockUserManager

Alle implementierten Schnittstellen:
  `org.apache.jackrabbit.api.security.user.UserManager`

public class MockUserManager extends Object implements org.apache.jackrabbit.api.security.user.UserManager
Mock `UserManager` implementation.

## Feldübersicht

Felder
Modifizierer und Typ
Feld
Beschreibung
`protected Map<String,org.apache.jackrabbit.api.security.user.Authorizable>`
`authorizables`
`protected javax.jcr.Session`
`session`

### Von Schnittstelle geerbte Felder org.apache.jackrabbit.api.security.user.UserManager

`SEARCH_TYPE_AUTHORIZABLE, SEARCH_TYPE_GROUP, SEARCH_TYPE_USER`

## Konstruktorübersicht

Konstruktoren
Konstruktor
Beschreibung
`MockUserManager()`
Veraltet.
use `MockUserManager(Session)` instead
`MockUserManager(javax.jcr.Session session)`

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`void`
`autoSave(boolean autoSave)`
`@NotNull org.apache.jackrabbit.api.security.user.Group`
`createGroup(@NotNull String groupID)`
`@NotNull org.apache.jackrabbit.api.security.user.Group`
`createGroup(@NotNull String groupID, @NotNull Principal principal, @Nullable String intermediatePath)`
`@NotNull org.apache.jackrabbit.api.security.user.Group`
`createGroup(@NotNull Principal principal)`
`@NotNull org.apache.jackrabbit.api.security.user.Group`
`createGroup(@NotNull Principal principal, @Nullable String intermediatePath)`
`@NotNull org.apache.jackrabbit.api.security.user.User`
`createSystemUser(@NotNull String userID, @Nullable String intermediatePath)`
`@NotNull org.apache.jackrabbit.api.security.user.User`
`createUser(@NotNull String userID, @Nullable String password)`
`@NotNull org.apache.jackrabbit.api.security.user.User`
`createUser(@NotNull String userID, @Nullable String password, @NotNull Principal principal, @Nullable String intermediatePath)`
`protected javax.jcr.Node`
`ensureAuthorizablePathExists(@NotNull String intermediatePath, @NotNull String principalName, @NotNull String authorizableNodeType)`
Creates the user/group home folder if they don't exist yet
`protected javax.jcr.Node`
`ensureAuthorizablePathExists(@Nullable String intermediatePath, @NotNull String principalName, boolean isGroup)`
Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.
use `ensureAuthorizablePathExists(String, String, String)` instead
`@NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable>`
`findAuthorizables(@NotNull String relPath, @Nullable String value)`
`@NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable>`
`findAuthorizables(@NotNull String relPath, @Nullable String value, int searchType)`
`@NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable>`
`findAuthorizables(@NotNull org.apache.jackrabbit.api.security.user.Query query)`
`@Nullable org.apache.jackrabbit.api.security.user.Authorizable`
`getAuthorizable(@NotNull String id)`
`<T extends org.apache.jackrabbit.api.security.user.Authorizable>
T`
`getAuthorizable(@NotNull String id, @NotNull Class<T> authorizableClass)`
`@Nullable org.apache.jackrabbit.api.security.user.Authorizable`
`getAuthorizable(@NotNull Principal principal)`
`@Nullable org.apache.jackrabbit.api.security.user.Authorizable`
`getAuthorizableByPath(@NotNull String path)`
`boolean`
`isAutoSave()`
`protected @Nullable String`
`toPrincipalName(@Nullable String id, @Nullable Principal principal)`
Calculates the principal name, preferring the supplied id or fallback to the `Principal.getName()` value

### Von Klasse geerbte Methoden java.lang.Object

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

## Felddetails

### session

protected javax.jcr.Session session

### authorizables

protected Map<String,org.apache.jackrabbit.api.security.user.Authorizable> authorizables

## Konstruktordetails

### MockUserManager

@Deprecated public MockUserManager()
Veraltet.
use `MockUserManager(Session)` instead

### MockUserManager

public MockUserManager(javax.jcr.Session session)

Parameter:
  `session` - the jcr session where the people state is stored

## Methodendetails

### isAutoSave

public boolean isAutoSave()

Angegeben von:
  `isAutoSave` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`

### autoSave

public void autoSave(boolean autoSave) throws javax.jcr.RepositoryException

Angegeben von:
  `autoSave` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### createGroup

@NotNull public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup(@NotNull @NotNull String groupID) throws javax.jcr.RepositoryException

Angegeben von:
  `createGroup` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### createGroup

@NotNull public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup(@NotNull @NotNull Principal principal) throws javax.jcr.RepositoryException

Angegeben von:
  `createGroup` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### createGroup

@NotNull public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup(@NotNull @NotNull Principal principal, @Nullable @Nullable String intermediatePath) throws javax.jcr.RepositoryException

Angegeben von:
  `createGroup` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### createGroup

@NotNull public @NotNull org.apache.jackrabbit.api.security.user.Group createGroup(@NotNull @NotNull String groupID, @NotNull @NotNull Principal principal, @Nullable @Nullable String intermediatePath) throws javax.jcr.RepositoryException

Angegeben von:
  `createGroup` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### toPrincipalName

@Nullable protected @Nullable String toPrincipalName(@Nullable @Nullable String id, @Nullable @Nullable Principal principal)
Calculates the principal name, preferring the supplied id or fallback to the `Principal.getName()` value

Parameter:
  `id` - the user or group id
  `principal` - the principal
Gibt zurück:
  the principal name

### ensureAuthorizablePathExists

@Deprecated(forRemoval=true, since="1.4.0") protected javax.jcr.Node ensureAuthorizablePathExists(@Nullable @Nullable String intermediatePath, @NotNull @NotNull String principalName, boolean isGroup) throws javax.jcr.RepositoryException
Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.
use `ensureAuthorizablePathExists(String, String, String)` instead
Creates the user/group home folder if they don't exist yet

Parameter:
  `intermediatePath` - the parent path
  `principalName` - Principal name
  `isGroup` - Is group
Gibt zurück:
  Existing or created node
Löst aus:
  `javax.jcr.RepositoryException` - Repository exception

### ensureAuthorizablePathExists

protected javax.jcr.Node ensureAuthorizablePathExists(@NotNull @NotNull String intermediatePath, @NotNull @NotNull String principalName, @NotNull @NotNull String authorizableNodeType) throws javax.jcr.RepositoryException
Creates the user/group home folder if they don't exist yet

Parameter:
  `intermediatePath` - the parent path
  `principalName` - Principal name
  `authorizableNodeType` - the node type for the user or group node
Gibt zurück:
  Existing or created node
Löst aus:
  `javax.jcr.RepositoryException` - Repository exception

### createSystemUser

@NotNull public @NotNull org.apache.jackrabbit.api.security.user.User createSystemUser(@NotNull @NotNull String userID, @Nullable @Nullable String intermediatePath) throws javax.jcr.RepositoryException

Angegeben von:
  `createSystemUser` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### createUser

@NotNull public @NotNull org.apache.jackrabbit.api.security.user.User createUser(@NotNull @NotNull String userID, @Nullable @Nullable String password) throws javax.jcr.RepositoryException

Angegeben von:
  `createUser` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### createUser

@NotNull public @NotNull org.apache.jackrabbit.api.security.user.User createUser(@NotNull @NotNull String userID, @Nullable @Nullable String password, @NotNull @NotNull Principal principal, @Nullable @Nullable String intermediatePath) throws javax.jcr.RepositoryException

Angegeben von:
  `createUser` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### findAuthorizables

@NotNull public @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> findAuthorizables(@NotNull @NotNull org.apache.jackrabbit.api.security.user.Query query) throws javax.jcr.RepositoryException

Angegeben von:
  `findAuthorizables` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### findAuthorizables

@NotNull public @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> findAuthorizables(@NotNull @NotNull String relPath, @Nullable @Nullable String value) throws javax.jcr.RepositoryException

Angegeben von:
  `findAuthorizables` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### findAuthorizables

@NotNull public @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> findAuthorizables(@NotNull @NotNull String relPath, @Nullable @Nullable String value, int searchType) throws javax.jcr.RepositoryException

Angegeben von:
  `findAuthorizables` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### getAuthorizable

@Nullable public @Nullable org.apache.jackrabbit.api.security.user.Authorizable getAuthorizable(@NotNull @NotNull String id) throws javax.jcr.RepositoryException

Angegeben von:
  `getAuthorizable` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### getAuthorizable

@Nullable public @Nullable org.apache.jackrabbit.api.security.user.Authorizable getAuthorizable(@NotNull @NotNull Principal principal) throws javax.jcr.RepositoryException

Angegeben von:
  `getAuthorizable` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### getAuthorizable

@Nullable public <T extends org.apache.jackrabbit.api.security.user.Authorizable> T getAuthorizable(@NotNull @NotNull String id, @NotNull @NotNull Class<T> authorizableClass) throws javax.jcr.RepositoryException

Angegeben von:
  `getAuthorizable` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`

### getAuthorizableByPath

@Nullable public @Nullable org.apache.jackrabbit.api.security.user.Authorizable getAuthorizableByPath(@NotNull @NotNull String path) throws javax.jcr.RepositoryException

Angegeben von:
  `getAuthorizableByPath` in Schnittstelle `org.apache.jackrabbit.api.security.user.UserManager`
Löst aus:
  `javax.jcr.RepositoryException`