Class DefaultUserService
- java.lang.Object
-
- org.apache.archiva.redback.rest.services.v2.BaseRedbackService
-
- org.apache.archiva.redback.rest.services.v2.DefaultUserService
-
- All Implemented Interfaces:
UserService
@Service("v2.userService#rest") public class DefaultUserService extends BaseRedbackService implements UserService
-
-
Field Summary
-
Fields inherited from class org.apache.archiva.redback.rest.services.v2.BaseRedbackService
DEFAULT_SEARCH_FIELDS, rbacManager, USER_FILTER_MAP, USER_ORDER_MAP, USER_QUERY_HELPER, userManager
-
-
Constructor Summary
Constructors Constructor Description DefaultUserService(RBACManager rbacManager, UserManager userManager, SecuritySystem securitySystem)
-
Method Summary
-
Methods inherited from class org.apache.archiva.redback.rest.services.v2.BaseRedbackService
getAssignedRedbackUsers, getAssignedRedbackUsersRecursive, getAssignedUsersRecursive, getChildRoles, getParentRoles, getRedbackUser, getRestUser, getRoleInfo, getRoleInfoOptional, getUserInfoPagedResult, isAscending
-
-
-
-
Constructor Detail
-
DefaultUserService
@Inject public DefaultUserService(@Named("rbacManager#default") RBACManager rbacManager, @Named("userManager#default") UserManager userManager, SecuritySystem securitySystem)
-
-
Method Detail
-
createUser
public UserInfo createUser(User user) throws RedbackServiceException
- Specified by:
createUser
in interfaceUserService
- Throws:
RedbackServiceException
-
deleteUser
public void deleteUser(String userId) throws RedbackServiceException
- Specified by:
deleteUser
in interfaceUserService
- Throws:
RedbackServiceException
-
getUser
public UserInfo getUser(String userId) throws RedbackServiceException
- Specified by:
getUser
in interfaceUserService
- Throws:
RedbackServiceException
-
getUsers
public org.apache.archiva.components.rest.model.PagedResult<UserInfo> getUsers(String q, Integer offset, Integer limit, List<String> orderBy, String order) throws RedbackServiceException
- Specified by:
getUsers
in interfaceUserService
- Throws:
RedbackServiceException
-
updateMe
public UserInfo updateMe(SelfUserData user) throws RedbackServiceException
Description copied from interface:UserService
Update only the current logged in user and this fields: fullname, email, password. The service verifies the current logged user with the one passed in the method- Specified by:
updateMe
in interfaceUserService
- Returns:
- the user info object
- Throws:
RedbackServiceException
-
getLoggedInUser
public UserInfo getLoggedInUser() throws RedbackServiceException
- Specified by:
getLoggedInUser
in interfaceUserService
- Throws:
RedbackServiceException
-
updateUser
public UserInfo updateUser(String userId, User user) throws RedbackServiceException
- Specified by:
updateUser
in interfaceUserService
- Throws:
RedbackServiceException
-
removeFromCache
public javax.ws.rs.core.Response removeFromCache(String userId) throws RedbackServiceException
- Specified by:
removeFromCache
in interfaceUserService
- Throws:
RedbackServiceException
-
ping
public PingResult ping() throws RedbackServiceException
- Specified by:
ping
in interfaceUserService
- Throws:
RedbackServiceException
-
createAdminUser
public UserInfo createAdminUser(User adminUser) throws RedbackServiceException
Description copied from interface:UserService
will create admin user only if not exists !! if exists will return false- Specified by:
createAdminUser
in interfaceUserService
- Throws:
RedbackServiceException
-
getAdminStatus
public AvailabilityStatus getAdminStatus() throws RedbackServiceException
- Specified by:
getAdminStatus
in interfaceUserService
- Throws:
RedbackServiceException
-
resetPassword
public javax.ws.rs.core.Response resetPassword(String userId) throws RedbackServiceException
Description copied from interface:UserService
Asks for a password reset of the given User. Normally this results in a password reset email sent to the stored email address for the given user.- Specified by:
resetPassword
in interfaceUserService
- Throws:
RedbackServiceException
-
registerUser
public RegistrationKey registerUser(String userId, UserRegistrationRequest userRegistrationRequest) throws RedbackServiceException
- Specified by:
registerUser
in interfaceUserService
- Returns:
- the registration key
- Throws:
RedbackServiceException
-
getCurrentUserPermissions
public Collection<Permission> getCurrentUserPermissions() throws RedbackServiceException
- Specified by:
getCurrentUserPermissions
in interfaceUserService
- Returns:
- the current logged user permissions, if no logged user guest permissions are returned
- Throws:
RedbackServiceException
-
getCurrentUserOperations
public Collection<Operation> getCurrentUserOperations() throws RedbackServiceException
- Specified by:
getCurrentUserOperations
in interfaceUserService
- Returns:
- the current logged user operations, if no logged user guest operations are returned
- Throws:
RedbackServiceException
-
validateUserRegistration
public VerificationStatus validateUserRegistration(String userId, String key) throws RedbackServiceException
- Specified by:
validateUserRegistration
in interfaceUserService
- Throws:
RedbackServiceException
-
getEffectivelyAssignedRoles
public List<RoleInfo> getEffectivelyAssignedRoles(String username) throws RedbackServiceException
Description copied from interface:UserService
Returns all roles for a given user id. Recurses all child roles.- Specified by:
getEffectivelyAssignedRoles
in interfaceUserService
- Throws:
RedbackServiceException
-
getRoleTree
public RoleTree getRoleTree(String username) throws RedbackServiceException
- Specified by:
getRoleTree
in interfaceUserService
- Throws:
RedbackServiceException
-
changePasswordUnauthenticated
public javax.ws.rs.core.Response changePasswordUnauthenticated(String userId, PasswordChange passwordChange) throws RedbackServiceException
- Specified by:
changePasswordUnauthenticated
in interfaceUserService
- Throws:
RedbackServiceException
-
changePassword
public javax.ws.rs.core.Response changePassword(PasswordChange passwordChange) throws RedbackServiceException
- Specified by:
changePassword
in interfaceUserService
- Throws:
RedbackServiceException
-
getUserOperations
public Collection<Operation> getUserOperations(String userName) throws RedbackServiceException
- Specified by:
getUserOperations
in interfaceUserService
- Throws:
RedbackServiceException
-
getUserPermissions
public Collection<Permission> getUserPermissions(String userName) throws RedbackServiceException
- Specified by:
getUserPermissions
in interfaceUserService
- Throws:
RedbackServiceException
-
getGuestPermissions
public Collection<Permission> getGuestPermissions() throws RedbackServiceException
- Specified by:
getGuestPermissions
in interfaceUserService
- Throws:
RedbackServiceException
-
validateCredentialsLoose
public void validateCredentialsLoose(User user) throws RedbackServiceException
- Throws:
RedbackServiceException
-
validateCredentialsStrict
public void validateCredentialsStrict(User user) throws RedbackServiceException
- Throws:
RedbackServiceException
-
unlockUser
public void unlockUser(String userId) throws RedbackServiceException
- Specified by:
unlockUser
in interfaceUserService
- Throws:
RedbackServiceException
-
lockUser
public void lockUser(String userId) throws RedbackServiceException
- Specified by:
lockUser
in interfaceUserService
- Throws:
RedbackServiceException
-
setRequirePasswordChangeFlag
public void setRequirePasswordChangeFlag(String userId) throws RedbackServiceException
- Specified by:
setRequirePasswordChangeFlag
in interfaceUserService
- Throws:
RedbackServiceException
-
clearRequirePasswordChangeFlag
public void clearRequirePasswordChangeFlag(String userId) throws RedbackServiceException
- Specified by:
clearRequirePasswordChangeFlag
in interfaceUserService
- Throws:
RedbackServiceException
-
-