public interface UserProfileService extends ContextSensitiveSingletonService
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.
Modifier and Type | Field and Description |
---|---|
static boolean |
authenticateUser$UPDATES |
static boolean |
createUser$UPDATES |
static boolean |
createUsers$UPDATES |
static boolean |
findAllUsersPaging$UPDATES |
static boolean |
findUsers$UPDATES |
static boolean |
findUsersPaging$UPDATES |
static boolean |
getApplicationName$UPDATES |
static boolean |
getUser$UPDATES |
static boolean |
getUserByUuid$UPDATES |
static boolean |
getUserPreferences$UPDATES |
static boolean |
getUsers$UPDATES |
static boolean |
getUsersByUuid$UPDATES |
static boolean |
getUsersCreation$UPDATES |
static boolean |
getUsersForGroupByRolePaging$UPDATES |
static boolean |
getWorkspace$UPDATES |
static boolean |
searchUserProfilesPaging$UPDATES |
static boolean |
setUserPreferences$UPDATES |
static boolean |
updateUser$UPDATES |
static boolean |
updateUsers$UPDATES |
CONFIGURE_METHOD_NAME
Modifier and Type | Method and Description |
---|---|
UserProfile |
authenticateUser(java.lang.String username_,
java.lang.String password_)
Deprecated.
Since 6.0.2, use
#authenticate(String, byte[]) |
java.lang.String |
createUser(UserProfile userprofile_)
Creates a new user
The
username field of the created user
must be unique. |
java.lang.String[] |
createUsers(UserProfile[] userprofiles_)
Creates new users.
|
ResultPage |
findAllUsersPaging(boolean caseSensitive_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Fast method that gets all users.
|
UserProfile[] |
findUsers(UserSearch userSearch_,
boolean caseSensitive_)
Deprecated.
|
ResultPage |
findUsersPaging(UserSearch userSearch_,
boolean caseSensitive_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Finds a list of users for a given search criteria.
|
java.lang.String |
getApplicationName()
Gets the name of the application on which this service is running.
|
UserProfile |
getUser(java.lang.String username_)
Gets a single user by username.
|
UserProfile |
getUserByUuid(java.lang.String uuid)
Gets a single user by uuid.
|
UserPreferences |
getUserPreferences()
Returns current user's preferences
|
UserProfile[] |
getUsers(java.lang.String[] usernames_)
Retrieves a list of users by username.
|
UserProfile[] |
getUsersByUuid(java.lang.String[] uuids)
Retrieves a list of users by uuid.
|
java.sql.Timestamp[] |
getUsersCreation(java.lang.String[] usernames)
Gets the users creation date
|
UserProfile[] |
getUsersForGroupByRolePaging(java.lang.Long groupId_,
int role_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
|
java.lang.String[] |
getWorkspace()
Gets the current memory profile for the workspace.
|
ResultPage |
searchUserProfilesPaging(java.lang.String query_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Searches for
User s by first, last, and username and returns
the UserProfile objects for each found User |
void |
setUserPreferences(UserPreferences preferences_)
Set current user's preferences
|
void |
updateUser(UserProfile userprofile_)
Updates a user.
|
void |
updateUsers(UserProfile[] userprofiles_)
Updates users.
|
configureContextSensitiveSingletonService
static final boolean getUser$UPDATES
static final boolean getUsers$UPDATES
static final boolean getUserByUuid$UPDATES
static final boolean getUsersByUuid$UPDATES
static final boolean getUsersCreation$UPDATES
static final boolean getUsersForGroupByRolePaging$UPDATES
static final boolean authenticateUser$UPDATES
static final boolean findUsers$UPDATES
static final boolean findUsersPaging$UPDATES
static final boolean createUser$UPDATES
static final boolean createUsers$UPDATES
static final boolean updateUser$UPDATES
static final boolean updateUsers$UPDATES
static final boolean findAllUsersPaging$UPDATES
static final boolean searchUserProfilesPaging$UPDATES
static final boolean getApplicationName$UPDATES
static final boolean getWorkspace$UPDATES
static final boolean getUserPreferences$UPDATES
static final boolean setUserPreferences$UPDATES
UserProfile getUser(java.lang.String username_) throws InvalidUserException
username_
- the unique username of the userUserProfile
corresponding to the
username_
InvalidUserException
- if the given username does correspond to a
valid userServiceException
- if any system-level error occursUserProfile[] getUsers(java.lang.String[] usernames_) throws InvalidUserException
usernames_
- the unique usernames of the users objectsUserProfile
objects corresponding to the
usernames_
InvalidUserException
- if a given username does not existServiceException
- if any system-level error occursUserProfile getUserByUuid(@ConvertWith(value=com.appiancorp.kougar.mapper.parameters.UuidParameterConverter.class) java.lang.String uuid) throws InvalidUserException
uuid
- the unique uuid of the userUserProfile
corresponding to the
uuid
InvalidUserException
- if the given uuid does correspond to a
valid userServiceException
- if any system-level error occursUserProfile[] getUsersByUuid(@ConvertWith(value=com.appiancorp.kougar.mapper.parameters.UuidParameterConverter[].class[]) java.lang.String[] uuids) throws InvalidUserException
uuids
- the unique uuids of the users objectsUserProfile
objects corresponding to the
uuids
InvalidUserException
- if a given uuid does not correspond to a valid userServiceException
- if any system-level error occursjava.sql.Timestamp[] getUsersCreation(java.lang.String[] usernames) throws InvalidUserException
usernames
- The list of usersInvalidUserException
@Deprecated UserProfile[] getUsersForGroupByRolePaging(java.lang.Long groupId_, int role_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_) throws InvalidGroupException, UnsupportedRoleException
groupId_
- ID of the group whose users should be retrievedrole_
- the role for which to retrieve users. Valid roles are one of
the USER_ROLE_XXX
constants in User
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 Constants.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 the SORT_BY_XXX
constants in
UserProfile
.sortOrder_
- the order in which to sort the results.
This is one of
Constants.SORT_ORDER_ASCENDING
or Constants.SORT_ORDER_DESCENDING
UserProfile
objects corresponding to the
users in the group with the given roleInvalidGroupException
- if the group given by
groupId_
does not existUnsupportedRoleException
- if the role is invalidServiceException
- if any system-level error occurs@Deprecated UserProfile authenticateUser(java.lang.String username_, java.lang.String password_) throws InvalidLoginException
#authenticate(String, byte[])
username_
- the unique username of a userpassword_
- the password for the userUserProfile
of the user with the given
usernameInvalidLoginException
- if the given username_
and
password_
are not those of a valid userServiceException
- if any system-level error occurs@Deprecated UserProfile[] findUsers(UserSearch userSearch_, boolean caseSensitive_) throws UnsupportedOperatorException
findUsersPaging(UserSearch, boolean, int, int, Integer, Integer)
instead.
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, the userSearch_
might have the
username
field set to "john.doe", the lastName
fields set to "Doe", the operatorUsername
field set to
Operator#EQUALS
and the operatorLastName
field
set to Operator#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.
userSearch_
- the search criteriacaseSensitive_
- whether the search is case sensitiveUnsupportedOperatorException
- if userSearch_
contains
an invalid operatorServiceException
- if any system-level error occursResultPage findUsersPaging(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_) throws UnsupportedOperatorException
findUsers(UserSearch, boolean)
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 of
Constants.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 the SORT_BY_XXX
constants in
UserProfile
sortOrder_
- Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,
Constants.SORT_ORDER_DESCENDING
for sorting results in descending orderResultPage
containing an array of
UserProfile
objects correpsonding to users who
match the search criteriaUnsupportedOperatorException
- if userSearch_
contains
an invalid operatorServiceException
- if any system-level error occursjava.lang.String createUser(UserProfile userprofile_) throws DuplicateNameException, PrivilegeException, InvalidSupervisorException, InvalidUserException, InvalidNameException
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 the password
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
,
then activateUserSession
must be called on the following services:
userprofile_
- a user to createDuplicateNameException
- if the username already existsPrivilegeException
- if the current user is not a System
AdministratorInvalidSupervisorException
- if the supervisor property is
neither null
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.java.lang.String[] createUsers(UserProfile[] userprofiles_) throws DuplicateNameException, InvalidNameException, PrivilegeException, InvalidSupervisorException, InvalidUserException
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 the password
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
,
then activateUserSession
must be called on the following services:
userprofiles_
- users to create.DuplicateNameException
- if any of the usernames already existsInvalidNameException
- if any username is null
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
either null
or the login of a valid userInvalidUserException
- if one of users_ is emptyServiceException
- if any system-level error occursvoid updateUser(UserProfile userprofile_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException
username
or
password
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
and userTypeName
when applied to the 'Administrator' user.
userprofile_
- the user to modifyInvalidUserException
- if a user with the given username does not
existInvalidSupervisorException
- if the supervisor property is
neither null
nor the login of a valid userServiceException
- if any system-level error occursPrivilegeException
void updateUsers(UserProfile[] userprofiles_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException
username
or
password
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
and userTypeName
when applied to the 'Administrator' user.
userprofiles_
- users to updateInvalidUserException
- if any user with a given username does not
existInvalidSupervisorException
- if the supervisor property is
neither null
nor the login of a valid userServiceException
- if any system-level error occursPrivilegeException
UserProfile
,
UserService.changeUserPassword(String, byte[], boolean)
ResultPage findAllUsersPaging(boolean caseSensitive_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_)
ResultPage
returned contains
UserProfile
objects sorted by the given sortProperty
.caseSensitive_
- whether the results should be sorted in a case sensitive
manner. Pass false
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 of
Constants.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 the SORT_BY_XXX
constants in
UserProfile
sortOrder_
- Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,
Constants.SORT_ORDER_DESCENDING
for sorting results in descending orderResultPage
containing an array of
UserProfile
objectsServiceException
- if any system-level error occursResultPage searchUserProfilesPaging(java.lang.String query_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_)
User
s by first, last, and username and returns
the UserProfile
objects for each found User
query_
- The query by which to search for UserProfile
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.
Use Constants.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 the SORT_BY_XXX
constants in
UserProfile
sortOrder_
- the order in which to sort the results.
This is one of
Constants.SORT_ORDER_ASCENDING
or Constants.SORT_ORDER_DESCENDING
ResultPage
of UserProfile
objects
which match the query.ServiceException
- if any system-level error occursjava.lang.String getApplicationName()
ServiceException
- if any system-level error occursjava.lang.String[] getWorkspace()
ServiceException
- if any system-level error occursUserPreferences getUserPreferences()
UserPreferences
void setUserPreferences(UserPreferences preferences_)
preferences_
- The UserPreferences
for the current userCopyright © 2003-2024 Appian Corporation. All Rights Reserved.