public class User extends AbstractAuthorizable
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ASYNC_WAIT_MILLIS
How many millisecond to wait before giving up on waiting for an async index to be updated.
|
protected UserProfile |
profile |
static String |
ROOT_PATH |
authorizableId, authorizablePath, client
ACTION_CREATE_GROUP, ACTION_CREATE_USER, AUTHORIZABLE_ID, IMPERSONATORS, IS_IMPERSONATED, MEMBER_OF, MEMBERS, PARAM_ADD_IMPERSONATORS, PARAM_ADD_MEMBERS, PARAM_AUTHORIZABLE_ID, PARAM_CREATE_GROUP, PARAM_CREATE_USER, PARAM_DELETE, PARAM_INTERMEDIATE_PATH, PARAM_PASSWORD, PARAM_REMOVE_IMPERSONATORS, PARAM_REMOVE_MEMBERS, PROFILE, SCHEMA_AUTHORIZABLE, SELECTOR, SELECTOR_USERPROPERTIES, TYPE, TYPE_GROUP, TYPE_USER, WILDCARD
Modifier and Type | Method and Description |
---|---|
<T extends User> |
addImpersonators(T[] authorizables,
int... expectedStatus)
Adds impersonators to the user.
|
static <T extends SecurityClient> |
createUser(T client,
String userId,
String password,
String intermediatePath,
Map<String,String> profileMap,
boolean waitForIndex,
int... expectedStatus)
Creates a new user.
|
static <T extends SecurityClient> |
createUser(T client,
String userId,
String password,
String intermediatePath,
Map<String,String> profileMap,
int... expectedStatus)
Creates a new user.
|
String |
getRootPath()
Get root path of the authorizable (user/group) in repository
|
UserProfile |
getUserProfile()
Get user profile
|
protected void |
initProfile() |
<T extends User> |
removeImpersonators(T[] authorizables,
int... expectedStatus)
Remove impersonators from the user
|
buildAuthorizableList, buildAuthorizablePath, create, delete, doGet, doPost, encodePathToURL, encodeURI, exists, getAuthorizableClass, getClient, getHomePath, getHomeUrl, getId, getImpersonators, getJsonAsString, getMemberOf, getMembers, getProfile, getUserPropertiesJsonAsString, isImpersonated
public static final String ROOT_PATH
public static final int MAX_ASYNC_WAIT_MILLIS
How many millisecond to wait before giving up on waiting for an async index to be updated.
By default it will wait 6000
ms but it can be fine tuned with, for example
-Dgranite.it.maxasync=12000
protected UserProfile profile
public User(T client, String authorizableId) throws org.apache.sling.testing.clients.ClientException, InterruptedException
org.apache.sling.testing.clients.ClientException
InterruptedException
public String getRootPath()
Authorizable
public <T extends User> org.apache.sling.testing.clients.SlingHttpResponse addImpersonators(T[] authorizables, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
T
- user typeauthorizables
- list of any User
objectsexpectedStatus
- list of allowed HTTP Status to be returned.org.apache.sling.testing.clients.ClientException
- if something fails during request/response cycleInterruptedException
- if waiting was interruptedpublic <T extends User> org.apache.sling.testing.clients.SlingHttpResponse removeImpersonators(T[] authorizables, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
T
- user typeauthorizables
- list of any User
objectsexpectedStatus
- list of allowed HTTP Status to be returned.org.apache.sling.testing.clients.ClientException
- If something fails during request/response cyclepublic UserProfile getUserProfile() throws org.apache.sling.testing.clients.ClientException
UserProfile
org.apache.sling.testing.clients.ClientException
- if the request failedprotected void initProfile() throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public static <T extends SecurityClient> User createUser(T client, String userId, String password, String intermediatePath, Map<String,String> profileMap, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
T
- client typeclient
- any class implementing the SecurityClient
.userId
- the user ID for the new user.password
- the password to be assigned.intermediatePath
- the root path user will be created.profileMap
- profile properties to be set for the new user.expectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 201 (CREATED) is assumed.User
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"public static <T extends SecurityClient> User createUser(T client, String userId, String password, String intermediatePath, Map<String,String> profileMap, boolean waitForIndex, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
T
- client typeclient
- any class implementing the SecurityClient
.userId
- the user ID for the new user.password
- the password to be assigned.intermediatePath
- the root path user will be created.profileMap
- profile properties to be set for the new user.waitForIndex
- Whether or not to wait for indexing to be complete before returningexpectedStatus
- list of allowed HTTP Status to be returned. If not set,
http status 201 (CREATED) is assumed.User
org.apache.sling.testing.clients.ClientException
- If something fails during request/response cycleInterruptedException
- to mark this method as "waiting"Copyright © 2018. All rights reserved.