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:
createUserin interfaceUserService- Throws:
RedbackServiceException
-
deleteUser
public void deleteUser(String userId) throws RedbackServiceException
- Specified by:
deleteUserin interfaceUserService- Throws:
RedbackServiceException
-
getUser
public UserInfo getUser(String userId) throws RedbackServiceException
- Specified by:
getUserin 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:
getUsersin interfaceUserService- Throws:
RedbackServiceException
-
updateMe
public UserInfo updateMe(SelfUserData user) throws RedbackServiceException
Description copied from interface:UserServiceUpdate 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:
updateMein interfaceUserService- Returns:
- the user info object
- Throws:
RedbackServiceException
-
getLoggedInUser
public UserInfo getLoggedInUser() throws RedbackServiceException
- Specified by:
getLoggedInUserin interfaceUserService- Throws:
RedbackServiceException
-
updateUser
public UserInfo updateUser(String userId, User user) throws RedbackServiceException
- Specified by:
updateUserin interfaceUserService- Throws:
RedbackServiceException
-
removeFromCache
public javax.ws.rs.core.Response removeFromCache(String userId) throws RedbackServiceException
- Specified by:
removeFromCachein interfaceUserService- Throws:
RedbackServiceException
-
ping
public PingResult ping() throws RedbackServiceException
- Specified by:
pingin interfaceUserService- Throws:
RedbackServiceException
-
createAdminUser
public UserInfo createAdminUser(User adminUser) throws RedbackServiceException
Description copied from interface:UserServicewill create admin user only if not exists !! if exists will return false- Specified by:
createAdminUserin interfaceUserService- Throws:
RedbackServiceException
-
getAdminStatus
public AvailabilityStatus getAdminStatus() throws RedbackServiceException
- Specified by:
getAdminStatusin interfaceUserService- Throws:
RedbackServiceException
-
resetPassword
public javax.ws.rs.core.Response resetPassword(String userId) throws RedbackServiceException
Description copied from interface:UserServiceAsks 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:
resetPasswordin interfaceUserService- Throws:
RedbackServiceException
-
registerUser
public RegistrationKey registerUser(String userId, UserRegistrationRequest userRegistrationRequest) throws RedbackServiceException
- Specified by:
registerUserin interfaceUserService- Returns:
- the registration key
- Throws:
RedbackServiceException
-
getCurrentUserPermissions
public Collection<Permission> getCurrentUserPermissions() throws RedbackServiceException
- Specified by:
getCurrentUserPermissionsin 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:
getCurrentUserOperationsin 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:
validateUserRegistrationin interfaceUserService- Throws:
RedbackServiceException
-
getEffectivelyAssignedRoles
public List<RoleInfo> getEffectivelyAssignedRoles(String username) throws RedbackServiceException
Description copied from interface:UserServiceReturns all roles for a given user id. Recurses all child roles.- Specified by:
getEffectivelyAssignedRolesin interfaceUserService- Throws:
RedbackServiceException
-
getRoleTree
public RoleTree getRoleTree(String username) throws RedbackServiceException
- Specified by:
getRoleTreein interfaceUserService- Throws:
RedbackServiceException
-
changePasswordUnauthenticated
public javax.ws.rs.core.Response changePasswordUnauthenticated(String userId, PasswordChange passwordChange) throws RedbackServiceException
- Specified by:
changePasswordUnauthenticatedin interfaceUserService- Throws:
RedbackServiceException
-
changePassword
public javax.ws.rs.core.Response changePassword(PasswordChange passwordChange) throws RedbackServiceException
- Specified by:
changePasswordin interfaceUserService- Throws:
RedbackServiceException
-
getUserOperations
public Collection<Operation> getUserOperations(String userName) throws RedbackServiceException
- Specified by:
getUserOperationsin interfaceUserService- Throws:
RedbackServiceException
-
getUserPermissions
public Collection<Permission> getUserPermissions(String userName) throws RedbackServiceException
- Specified by:
getUserPermissionsin interfaceUserService- Throws:
RedbackServiceException
-
getGuestPermissions
public Collection<Permission> getGuestPermissions() throws RedbackServiceException
- Specified by:
getGuestPermissionsin 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:
unlockUserin interfaceUserService- Throws:
RedbackServiceException
-
lockUser
public void lockUser(String userId) throws RedbackServiceException
- Specified by:
lockUserin interfaceUserService- Throws:
RedbackServiceException
-
setRequirePasswordChangeFlag
public void setRequirePasswordChangeFlag(String userId) throws RedbackServiceException
- Specified by:
setRequirePasswordChangeFlagin interfaceUserService- Throws:
RedbackServiceException
-
clearRequirePasswordChangeFlag
public void clearRequirePasswordChangeFlag(String userId) throws RedbackServiceException
- Specified by:
clearRequirePasswordChangeFlagin interfaceUserService- Throws:
RedbackServiceException
-
-