Interface UserProfileService
- All Superinterfaces:
ContextSensitiveSingletonService
,Service
Provides the main functionality needed to create, update, delete, and
retrieve UserProfile
objects from the Personalization service.
Methods of service classes can all throw the unchecked exception
ServiceException
if any
system-level error (for example, server failure) occurs, and will in general
throw a checked exception (InvalidXXXException
) when an entity
to be retrieved is inaccessible, instead of returning null
.
Exceptions to this paradigm (including the use of ResultList
as
described below) are noted. All checked exceptions extend
AppianException
.
It may be necessary to retrieve a subset of results as opposed to an entire
collection, and also to sort the subset by some property of the returned
object. "Paging" methods which return a
ResultPage
are provided in certain
instances for this purpose. The ResultPage
will contain the
sorted subset of results
(via Result.getResults()
), and the
total number of items in the available result set
(via ResultPage.getAvailableItems()
).
It may also be necessary to retrieve some results, even if all results
cannot be retrieved (for instance, some of the entities corresponding
to a list of entity IDs may no longer exist). Methods which return a
ResultList
are provided for this
purpose. The Result.getResults()
method in this case will return all results which can be retrieved. In
addition, there will be a list of result codes
(ResultList.getResultCodes()
) that
represent the successful retrieval of an entity, or, if the entity could
not be retrieved, the reason for the failure. See the CODE_XXX
constants in ResultList
for details.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
Fields inherited from interface com.appiancorp.services.ContextSensitiveSingletonService
CONFIGURE_METHOD_NAME
-
Method Summary
Modifier and TypeMethodDescriptionauthenticateUser
(String username_, String password_) Deprecated.createUser
(UserProfile userprofile_) Creates a new userString[]
createUsers
(UserProfile[] userprofiles_) Creates new users.findAllUsersPaging
(boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Fast method that gets all users.findUsers
(UserSearch userSearch_, boolean caseSensitive_) Deprecated.findUsersPaging
(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Finds a list of users for a given search criteria.Gets the name of the application on which this service is running.Gets a single user by username.getUserByUuid
(String uuid) Gets a single user by uuid.Returns current user's preferencesRetrieves a list of users by username.getUsersByUuid
(String[] uuids) Retrieves a list of users by uuid.getUsersCreation
(String[] usernames) Gets the users creation dategetUsersForGroupByRolePaging
(Long groupId_, int role_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) String[]
Gets the current memory profile for the workspace.searchUserProfilesPaging
(String query_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Searches forUser
s by first, last, and username and returns theUserProfile
objects for each foundUser
void
setUserPreferences
(UserPreferences preferences_) Set current user's preferencesvoid
updateUser
(UserProfile userprofile_) Updates a user.void
updateUsers
(UserProfile[] userprofiles_) Updates users.Methods inherited from interface com.appiancorp.services.ContextSensitiveSingletonService
configureContextSensitiveSingletonService
-
Field Details
-
getUser$UPDATES
static final boolean getUser$UPDATES- See Also:
-
getUsers$UPDATES
static final boolean getUsers$UPDATES- See Also:
-
getUserByUuid$UPDATES
static final boolean getUserByUuid$UPDATES- See Also:
-
getUsersByUuid$UPDATES
static final boolean getUsersByUuid$UPDATES- See Also:
-
getUsersCreation$UPDATES
static final boolean getUsersCreation$UPDATES- See Also:
-
getUsersForGroupByRolePaging$UPDATES
static final boolean getUsersForGroupByRolePaging$UPDATES- See Also:
-
authenticateUser$UPDATES
static final boolean authenticateUser$UPDATES- See Also:
-
findUsers$UPDATES
static final boolean findUsers$UPDATES- See Also:
-
findUsersPaging$UPDATES
static final boolean findUsersPaging$UPDATES- See Also:
-
createUser$UPDATES
static final boolean createUser$UPDATES- See Also:
-
createUsers$UPDATES
static final boolean createUsers$UPDATES- See Also:
-
updateUser$UPDATES
static final boolean updateUser$UPDATES- See Also:
-
updateUsers$UPDATES
static final boolean updateUsers$UPDATES- See Also:
-
findAllUsersPaging$UPDATES
static final boolean findAllUsersPaging$UPDATES- See Also:
-
searchUserProfilesPaging$UPDATES
static final boolean searchUserProfilesPaging$UPDATES- See Also:
-
getApplicationName$UPDATES
static final boolean getApplicationName$UPDATES- See Also:
-
getWorkspace$UPDATES
static final boolean getWorkspace$UPDATES- See Also:
-
getUserPreferences$UPDATES
static final boolean getUserPreferences$UPDATES- See Also:
-
setUserPreferences$UPDATES
static final boolean setUserPreferences$UPDATES- See Also:
-
-
Method Details
-
getUser
Gets a single user by username.- Parameters:
username_
- the unique username of the user- Returns:
- a
UserProfile
corresponding to theusername_
- Throws:
InvalidUserException
- if the given username does correspond to a valid userServiceException
- if any system-level error occurs
-
getUsers
Retrieves a list of users by username.- Parameters:
usernames_
- the unique usernames of the users objects- Returns:
- an array of
UserProfile
objects corresponding to theusernames_
- Throws:
InvalidUserException
- if a given username does not existServiceException
- if any system-level error occurs
-
getUserByUuid
UserProfile getUserByUuid(@ConvertWith(com.appiancorp.kougar.mapper.parameters.UuidParameterConverter.class) String uuid) throws InvalidUserException Gets a single user by uuid.- Parameters:
uuid
- the unique uuid of the user- Returns:
- a
UserProfile
corresponding to theuuid
- Throws:
InvalidUserException
- if the given uuid does correspond to a valid userServiceException
- if any system-level error occurs
-
getUsersByUuid
UserProfile[] getUsersByUuid(@ConvertWith(com.appiancorp.kougar.mapper.parameters.UuidParameterConverter[][].class) String[] uuids) throws InvalidUserException Retrieves a list of users by uuid.- Parameters:
uuids
- the unique uuids of the users objects- Returns:
- an array of
UserProfile
objects corresponding to theuuids
- Throws:
InvalidUserException
- if a given uuid does not correspond to a valid userServiceException
- if any system-level error occurs
-
getUsersCreation
Gets the users creation date- Parameters:
usernames
- The list of users- Returns:
- An array of timestamps with the user creation date.
- Throws:
InvalidUserException
-
getUsersForGroupByRolePaging
@Deprecated UserProfile[] getUsersForGroupByRolePaging(Long groupId_, int role_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidGroupException, UnsupportedRoleException Retrieves a list of users for a given group by user role.- Parameters:
groupId_
- ID of the group whose users should be retrievedrole_
- the role for which to retrieve users. Valid roles are one of theUSER_ROLE_XXX
constants inUser
startIndex_
- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_
- the number of results to return. UseConstants.COUNT_ALL
to return the entire collection, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sorted. This is one of theSORT_BY_XXX
constants inUserProfile
.sortOrder_
- the order in which to sort the results. This is one ofConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- an array of
UserProfile
objects corresponding to the users in the group with the given role - Throws:
InvalidGroupException
- if the group given bygroupId_
does not existUnsupportedRoleException
- if the role is invalidServiceException
- if any system-level error occurs
-
authenticateUser
@Deprecated UserProfile authenticateUser(String username_, String password_) throws InvalidLoginException Deprecated.Since 6.0.2, use#authenticate(String, byte[])
Used to validate a user (the login mechanism).- Parameters:
username_
- the unique username of a userpassword_
- the password for the user- Returns:
- the
UserProfile
of the user with the given username - Throws:
InvalidLoginException
- if the givenusername_
andpassword_
are not those of a valid userServiceException
- if any system-level error occurs
-
findUsers
@Deprecated UserProfile[] findUsers(UserSearch userSearch_, boolean caseSensitive_) throws UnsupportedOperatorException Deprecated.Finds a list of users for a given search criteria.The
userSearch_
object should be populated with the user fields to be searched on, and the criteria to be used in performing the search. For example, theuserSearch_
might have theusername
field set to "john.doe", thelastName
fields set to "Doe", theoperatorUsername
field set toOperator#EQUALS
and theoperatorLastName
field set toOperator#ENDS_WITH
. Such a search will return all users whose username is "john.doe", and whose last name ends with "Doe".See
GroupTypeService.getOperatorsForDataType(int)
to obtain a list of possible operators for a given data type.- Parameters:
userSearch_
- the search criteriacaseSensitive_
- whether the search is case sensitive- Returns:
- the users that meet the given search criteria
- Throws:
UnsupportedOperatorException
- ifuserSearch_
contains an invalid operatorServiceException
- if any system-level error occurs
-
findUsersPaging
ResultPage findUsersPaging(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws UnsupportedOperatorException Finds a list of users for a given search criteria. This method will return the paged resultset corresponding tofindUsers(UserSearch, boolean)
- Parameters:
userSearch_
- criteria for the searchcaseSensitive_
- whether the search is case sensitivestartIndex_
- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_
- the number of results to return. use ofConstants.COUNT_ALL
will result in the entire collection being returned, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sorted This is one of theSORT_BY_XXX
constants inUserProfile
sortOrder_
-Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,Constants.SORT_ORDER_DESCENDING
for sorting results in descending order- Returns:
- a
ResultPage
containing an array ofUserProfile
objects correpsonding to users who match the search criteria - Throws:
UnsupportedOperatorException
- ifuserSearch_
contains an invalid operatorServiceException
- if any system-level error occurs
-
createUser
String createUser(UserProfile userprofile_) throws DuplicateNameException, PrivilegeException, InvalidSupervisorException, InvalidUserException, InvalidNameException Creates a new userThe
username
field of the created user must be unique. User fields required for creation are:username
.NOTES:
1) Although this call will complete successfully if only the
username
field is populated, if thepassword
field is not also populated the created user will not able to log into the application.2) The
password
field must be hashed to work properly with the the product interface.3)In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the
username
be validated for illegal characters (only allow alphanumeric symbols, underscores, and periods).If, after a user is created, it is necessary to call any method using that user's
UserServiceContext
, thenactivateUserSession
must be called on the following services:- Parameters:
userprofile_
- a user to create- Returns:
- the username of the user
- Throws:
DuplicateNameException
- if the username already existsPrivilegeException
- if the current user is not a System AdministratorInvalidSupervisorException
- if the supervisor property is neithernull
nor the login of a valid userInvalidUserException
- if user_ is emptyServiceException
- if any system-level error occursInvalidNameException
- Never thrown. Is only declared for backwards compatibility.
-
createUsers
String[] createUsers(UserProfile[] userprofiles_) throws DuplicateNameException, InvalidNameException, PrivilegeException, InvalidSupervisorException, InvalidUserException Creates new users.The
username
field of the created user must be unique. User fields required for creation are:username
.NOTES:
1) Although this call will complete successfully if only the
username
field is populated, if thepassword
field is not also populated the created user will not able to log into the application.2) The
password
field must be hashed to work properly with the the product interface.3)In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the
username
be validated for illegal characters (only allow alphanumeric symbols, underscores, and periods).If, after a user is created, it is necessary to call any method using that user's
UserServiceContext
, thenactivateUserSession
must be called on the following services:- Parameters:
userprofiles_
- users to create.- Returns:
- the usernames of the users
- Throws:
DuplicateNameException
- if any of the usernames already existsInvalidNameException
- if any username isnull
PrivilegeException
- if the user is not a System Administrator Must be a System Administrator to create a user.InvalidSupervisorException
- if the supervisor property is not eithernull
or the login of a valid userInvalidUserException
- if one of users_ is emptyServiceException
- if any system-level error occurs
-
updateUser
void updateUser(UserProfile userprofile_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException Updates a user. Does not modifyusername
orpassword
fields.In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the
username
field be validated for illegal characters (only allow alphanumeric symbols and underscores).This method will ignore any changes to the properties
userTypeId
anduserTypeName
when applied to the 'Administrator' user.- Parameters:
userprofile_
- the user to modify- Throws:
InvalidUserException
- if a user with the given username does not existInvalidSupervisorException
- if the supervisor property is neithernull
nor the login of a valid userServiceException
- if any system-level error occursPrivilegeException
-
updateUsers
void updateUsers(UserProfile[] userprofiles_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException Updates users. Does not modifyusername
orpassword
fields. In order to minimize possible breaks with the user interface, it is HIGHLY recommended that theusername
field be validated for illegal characters (only allow alphanumeric symbols and underscores).This method will ignore any changes to the properties
userTypeId
anduserTypeName
when applied to the 'Administrator' user.- Parameters:
userprofiles_
- users to update- Throws:
InvalidUserException
- if any user with a given username does not existInvalidSupervisorException
- if the supervisor property is neithernull
nor the login of a valid userServiceException
- if any system-level error occursPrivilegeException
- See Also:
-
findAllUsersPaging
ResultPage findAllUsersPaging(boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Fast method that gets all users. TheResultPage
returned containsUserProfile
objects sorted by the givensortProperty
.- Parameters:
caseSensitive_
- whether the results should be sorted in a case sensitive manner. Passfalse
to sort in the common lexicographical order (e.g., a, A, b, B, c, C).startIndex_
- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_
- the number of results to return. use ofConstants.COUNT_ALL
will result in the entire collection being returned, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sorted This is one of theSORT_BY_XXX
constants inUserProfile
sortOrder_
-Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,Constants.SORT_ORDER_DESCENDING
for sorting results in descending order- Returns:
- a
ResultPage
containing an array ofUserProfile
objects - Throws:
ServiceException
- if any system-level error occurs
-
searchUserProfilesPaging
ResultPage searchUserProfilesPaging(String query_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Searches forUser
s by first, last, and username and returns theUserProfile
objects for each foundUser
- Parameters:
query_
- The query by which to search forUserProfile
s.startIndex_
- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_
- the number of results to return. UseConstants.COUNT_ALL
to return the entire collection, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sorted. This is one of theSORT_BY_XXX
constants inUserProfile
sortOrder_
- the order in which to sort the results. This is one ofConstants.SORT_ORDER_ASCENDING
orConstants.SORT_ORDER_DESCENDING
- Returns:
- A
ResultPage
ofUserProfile
objects which match the query. - Throws:
ServiceException
- if any system-level error occurs
-
getApplicationName
String getApplicationName()Gets the name of the application on which this service is running.- Returns:
- the name of the application
- Throws:
ServiceException
- if any system-level error occurs
-
getWorkspace
String[] getWorkspace()Gets the current memory profile for the workspace.- Returns:
- array of Strings of length 4 describing memory usage:
- [0]Used - Memory Used by the Server so far for storage
- [1]Allocated - Memory allocated for use. Often if a large data item was allocated by a server and subsequently freed, this value will be large compared to "Used". If nearly all memory allocated is in use, this value will be close to (but always higher than) "Used"
- [2]Mapped - is the space used by memory-mapped files
- [3]Available - is the total available memory for the Server process
- Throws:
ServiceException
- if any system-level error occurs
-
getUserPreferences
UserPreferences getUserPreferences()Returns current user's preferences- Returns:
- the
UserPreferences
-
setUserPreferences
Set current user's preferences- Parameters:
preferences_
- TheUserPreferences
for the current user
-
#authenticate(String, byte[])