public class UserManagement extends AbstractLangridService implements UserManagementService
Constructor and Description |
---|
UserManagement()
Constructor.
|
UserManagement(ServiceContext serviceContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addUser(String userId,
String password,
boolean canCallServices,
UserProfile profile,
Attribute[] attributes)
Adds a user.
|
void |
clear()
Clears all user data.
|
void |
deleteUser(String userId)
Deletes a user.
|
Calendar |
getPasswordChangedDate(String userId)
Gets date of user password change.
|
Attribute[] |
getUserAttributes(String userId,
String[] attributeNames)
Gets user's attribute data.
|
boolean |
getUserCanCallServices(String userId)
Gets whether or not user can call simple, composite services.
|
String |
getUserDigestedPassword(String userId)
Gets user's password.
|
String |
getUserPassword(String userId) |
UserProfile |
getUserProfile(String userId)
Gets user's profile.
|
void |
initialize()
Initializes user data.
|
UserEntrySearchResult |
searchUsers(int startIndex,
int maxCount,
MatchingCondition[] conditions,
Order[] orders)
Searches users over the specified conditions, sorts and returns.
|
UserEntrySearchResult |
searchUsersShouldChangePassword(int startIndex,
int maxCount,
int days,
Order[] orders)
Returns users whose password must be changed.
|
void |
setUserAttributes(String userId,
Attribute[] attributes)
Sets user's attribute data.
|
void |
setUserCanCallServices(String userId,
boolean canCallServices)
Sets whether or not user can call simple, composite services.
|
void |
setUserPassword(String userId,
String password)
Changes user's password.
|
void |
setUserProfile(String userId,
UserProfile profile)
Sets user profile data.
|
adjustDateFieldName, adjustDateFieldName, convert, convertException, convertException, convertException, convertException, convertException, convertException, convertException, convertException, convertException, convertUserOrder, copyAttributes, copyAttributes, copyProperties, getAccessLimitDao, getAccessLogDao, getAccessRightDao, getAccessStateDao, getConverter, getCoreNodeUrl, getDaoContext, getDaoFactory, getDefaultGridId, getFederationDao, getGridDao, getGridId, getNodeDao, getOverUseLimitDao, getOverUseStateDao, getResourceDao, getServiceContext, getServiceDao, getServiceDeploymentDao, getServiceLogic, getSystemPropertyDao, getTargetServiceIds, getTemporaryUserDao, getUserChecker, getUserDao, getUserLogic, unsetFactory
public UserManagement()
public UserManagement(ServiceContext serviceContext)
serviceContext
- Service context@AccessRightValidatedMethod(policy=ADMINONLY) @TransactionMethod public void clear() throws AccessLimitExceededException, NoAccessPermissionException, ServiceConfigurationException, UnknownException
UserManagementService
clear
in interface UserManagementService
AccessLimitExceededException
- Violated an access restrictionNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unknwon exception occurred@AccessRightValidatedMethod(policy=ADMINONLY) @TransactionMethod public void initialize() throws AccessLimitExceededException, NoAccessPermissionException, ServiceConfigurationException, UnknownException
UserManagementService
initialize
in interface UserManagementService
AccessLimitExceededException
- Violated an access restrictionNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unknwon exception occurred@ValidatedMethod @AccessRightValidatedMethod public UserEntrySearchResult searchUsers(@IntNotNegative int startIndex, @IntInRange(minimum=0,maximum=100) int maxCount, @NotNull@EachElement@ValidMatchingCondition MatchingCondition[] conditions, @NotNull@EachElement@ValidOrder Order[] orders) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UnsupportedMatchingMethodException
UserManagementService
searchUsers
in interface UserManagementService
startIndex
- Starting position of acquisitionmaxCount
- Maximum number of acquired resultsconditions
- Matching conditions. AND searchorders
- Sort conditionAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUnsupportedMatchingMethodException
@ValidatedMethod @AccessRightValidatedMethod(policy=ADMINONLY) @TransactionMethod public UserEntrySearchResult searchUsersShouldChangePassword(@IntNotNegative int startIndex, @IntInRange(minimum=0,maximum=100) int maxCount, @IntNotNegative int days, @NotNull@EachElement@ValidOrder Order[] orders) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException
UserManagementService
searchUsersShouldChangePassword
in interface UserManagementService
startIndex
- Start indexmaxCount
- Number of search resultsdays
- Days elapsed since password changeorders
- Sort orderAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurred@ValidatedMethod @AccessRightValidatedMethod(policy=ADMINONLY) public void addUser(@NotEmpty@ValidUserId String userId, @NotEmpty String password, boolean canCallServices, @NotNull UserProfile profile, @NotNull@EachElement@ValidAttribute Attribute[] attributes) throws AccessLimitExceededException, InvalidParameterException, InvalidUserIdException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserAlreadyExistsException
UserManagementService
addUser
in interface UserManagementService
userId
- Usernamepassword
- PasswordcanCallServices
- Whether or not services can be calledprofile
- Profileattributes
- AttributeAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedInvalidUserIdException
- An invalid user ID was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserAlreadyExistsException
- The specified user already exists@ValidatedMethod @AccessRightValidatedMethod(policy=ADMINONLY) public void deleteUser(@NotEmpty@ValidUserId String userId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
UserManagementService
deleteUser
in interface UserManagementService
userId
- Username of the user to be deletedAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user does not exist@ValidatedMethod @AccessRightValidatedMethod @TransactionMethod public UserProfile getUserProfile(@NotEmpty@ValidUserId String userId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
UserManagementService
getUserProfile
in interface UserManagementService
userId
- UsernameAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user does not exist@AccessRightValidatedMethod(policy=SELF_OR_ADMIN, argNames="userId") @ValidatedMethod public void setUserProfile(@NotEmpty@ValidUserId String userId, @NotNull UserProfile profile) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
UserManagementService
setUserProfile
in interface UserManagementService
userId
- User IDprofile
- User profile dataAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user was not found@AccessRightValidatedMethod(policy=SELF_OR_ADMIN, argNames="userId") @ValidatedMethod @TransactionMethod public Attribute[] getUserAttributes(@NotEmpty@ValidUserId String userId, @NotNull@EachElement@ValidAttributeName String[] attributeNames) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
When an attribute name is specified that does not exist in attributeNames, that attribute name is ignored. When an empty string is set, gets all attributes which can be acquired.
getUserAttributes
in interface UserManagementService
userId
- User IDattributeNames
- Array of names of acquired attributesAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user was not found@AccessRightValidatedMethod(policy=SELF_OR_ADMIN, argNames="userId") @ValidatedMethod @TransactionMethod public void setUserAttributes(@NotEmpty@ValidUserId String userId, @NotNull@EachElement@ValidAttribute Attribute[] attributes) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
When the specified attribute's value field is an empty string, that attribute is deleted.
setUserAttributes
in interface UserManagementService
userId
- User IDattributes
- Array of attribute data.AccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user was not found@ValidatedMethod @AccessRightValidatedMethod(policy=SELF_OR_ADMIN, argNames="userId") @TransactionMethod public void setUserPassword(@NotEmpty@ValidUserId String userId, @NotEmpty@ValidPassword String password) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
UserManagementService
setUserPassword
in interface UserManagementService
userId
- Usernamepassword
- PasswordAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user does not exist@ValidatedMethod @AccessRightValidatedMethod(policy=SELF_OR_ADMIN, argNames="userId") @TransactionMethod public Calendar getPasswordChangedDate(@NotEmpty@ValidUserId String userId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
UserManagementService
getPasswordChangedDate
in interface UserManagementService
userId
- UsernameAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user does not exist@ValidatedMethod @AccessRightValidatedMethod(policy=ADMINONLY) @TransactionMethod public String getUserPassword(@NotEmpty@ValidUserId String userId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
@ValidatedMethod @AccessRightValidatedMethod(policy=ADMINONLY) @TransactionMethod public String getUserDigestedPassword(@NotEmpty@ValidUserId String userId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
UserManagementService
getUserDigestedPassword
in interface UserManagementService
userId
- UsernameAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user does not exist@ValidatedMethod @AccessRightValidatedMethod(policy=SELF_OR_ADMIN) @TransactionMethod public boolean getUserCanCallServices(@NotEmpty@ValidUserId String userId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
This data is always prioritized over access privilege and access restriction settings. If false, even with access permission and the access count and transfer size within permissible range, will not call the service.
getUserCanCallServices
in interface UserManagementService
userId
- UsernameAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user does not exist@ValidatedMethod @AccessRightValidatedMethod(policy=ADMINONLY) @TransactionMethod public void setUserCanCallServices(@NotEmpty@ValidUserId String userId, boolean canCallServices) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ServiceConfigurationException, UnknownException, UserNotFoundException
This data is always prioritized over access privilege and access restriction settings. If false, even with access permission and the access count and transfer size within permissible range, will not call the service.
setUserCanCallServices
in interface UserManagementService
userId
- UsernamecanCallServices
- Whether or not the user can call simple and composite servicesAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedNoAccessPermissionException
- The user executing the call lacks execution privilegesServiceConfigurationException
- The service setup was not done appropriatelyUnknownException
- An unexpected exception occurredUserNotFoundException
- The specified user does not exist