Blue Mind
Release 1.0

net.bluemind.core.client.user
Class UserClient

java.lang.Object
  extended by net.bluemind.core.client.impl.AbstractClientImpl
      extended by net.bluemind.core.client.user.UserClient
All Implemented Interfaces:
IUser, ISyncClient

public class UserClient
extends AbstractClientImpl
implements IUser


Field Summary
 
Fields inherited from class net.bluemind.core.client.impl.AbstractClientImpl
logger
 
Constructor Summary
UserClient(java.lang.String backendUrl)
           
 
Method Summary
 java.lang.String changeMyPassword(AccessToken token, java.lang.String oldPass, java.lang.String newPass)
           
 java.lang.String changePassword(AccessToken token, java.lang.Integer id, java.lang.String oldPass, java.lang.String newPass)
           
 User create(AccessToken token, User user)
           
 User deleteUser(AccessToken token, int id)
           
 ResultList<User> find(AccessToken token, UserQuery uq)
           
 ResultList<User> findFromPatterns(AccessToken token, UserQuery uq)
          Used for users autocomplete
 ResultList<Group> getAllMyGroups(AccessToken token, int id)
          Get user membership groups hierarchy list, excluding profile groups.
 java.util.Set<java.lang.String> getDomainUsersExtId(AccessToken at, int domainId)
          Get ext ID list of not archived domain users
 java.lang.String getEncryptPassword(AccessToken at, int id)
          Get encrypted password.
 ResultList<Group> getGroups(AccessToken token, int id)
          Get user direct membership groups list
 ResultList<Group> getMyGroups(AccessToken token, int id)
          Get user direct membership groups list excluding profile groups
 java.lang.String getUserExtIdFromLogin(AccessToken at, java.lang.String userLogin, int domainId)
          Get user ext ID from not archived user login and domain ID
 User getUserFromId(AccessToken token, int id)
           
 AccessToken login(java.lang.String login, java.lang.String password, java.lang.String origin)
           
 void logout(AccessToken at)
           
 AccessToken sudo(AccessToken token, java.lang.String loginAtDomain)
          Returns an AccessToken for the given loginAtDomain.
 User update(AccessToken token, User user)
           
 User updateMyself(AccessToken token, User user)
           
 ValidationKind validate(java.lang.String loginAtDomain, java.lang.String password, java.lang.String origin)
           
 
Methods inherited from class net.bluemind.core.client.impl.AbstractClientImpl
checkServerError, execute, executeStream, executeVoid, initParams, setToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserClient

public UserClient(java.lang.String backendUrl)
Method Detail

getUserFromId

public User getUserFromId(AccessToken token,
                          int id)
                   throws AuthFault,
                          ServerFault
Specified by:
getUserFromId in interface IUser
Throws:
AuthFault
ServerFault

find

public ResultList<User> find(AccessToken token,
                             UserQuery uq)
                      throws AuthFault,
                             ServerFault
Specified by:
find in interface IUser
Throws:
AuthFault
ServerFault

findFromPatterns

public ResultList<User> findFromPatterns(AccessToken token,
                                         UserQuery uq)
                                  throws AuthFault,
                                         ServerFault
Description copied from interface: IUser
Used for users autocomplete

Specified by:
findFromPatterns in interface IUser
Returns:
Throws:
AuthFault
ServerFault

create

public User create(AccessToken token,
                   User user)
            throws AuthFault,
                   ServerFault
Specified by:
create in interface IUser
Throws:
AuthFault
ServerFault

update

public User update(AccessToken token,
                   User user)
            throws AuthFault,
                   ServerFault
Specified by:
update in interface IUser
Throws:
AuthFault
ServerFault

deleteUser

public User deleteUser(AccessToken token,
                       int id)
                throws AuthFault,
                       ServerFault
Specified by:
deleteUser in interface IUser
Throws:
AuthFault
ServerFault

getGroups

public ResultList<Group> getGroups(AccessToken token,
                                   int id)
                            throws AuthFault,
                                   ServerFault
Description copied from interface: IUser
Get user direct membership groups list

Specified by:
getGroups in interface IUser
Parameters:
token - bm-core token
id - user ID
Returns:
membership groups list
Throws:
AuthFault
ServerFault

login

public AccessToken login(java.lang.String login,
                         java.lang.String password,
                         java.lang.String origin)
Specified by:
login in interface ISyncClient
Overrides:
login in class AbstractClientImpl

logout

public void logout(AccessToken at)
Specified by:
logout in interface ISyncClient
Overrides:
logout in class AbstractClientImpl

changePassword

public java.lang.String changePassword(AccessToken token,
                                       java.lang.Integer id,
                                       java.lang.String oldPass,
                                       java.lang.String newPass)
                                throws AuthFault,
                                       ServerFault
Specified by:
changePassword in interface IUser
Throws:
AuthFault
ServerFault

changeMyPassword

public java.lang.String changeMyPassword(AccessToken token,
                                         java.lang.String oldPass,
                                         java.lang.String newPass)
                                  throws AuthFault,
                                         ServerFault
Specified by:
changeMyPassword in interface IUser
Throws:
AuthFault
ServerFault

updateMyself

public User updateMyself(AccessToken token,
                         User user)
                  throws ServerFault
Specified by:
updateMyself in interface IUser
Throws:
ServerFault

validate

public ValidationKind validate(java.lang.String loginAtDomain,
                               java.lang.String password,
                               java.lang.String origin)
Specified by:
validate in interface ISyncClient
Overrides:
validate in class AbstractClientImpl

sudo

public AccessToken sudo(AccessToken token,
                        java.lang.String loginAtDomain)
                 throws AuthFault,
                        ServerFault
Description copied from interface: ISyncClient
Returns an AccessToken for the given loginAtDomain. The provided AccessToken must be an admin0@global.virt token.

Specified by:
sudo in interface ISyncClient
Overrides:
sudo in class AbstractClientImpl
Returns:
Throws:
AuthFault
ServerFault

getEncryptPassword

public java.lang.String getEncryptPassword(AccessToken at,
                                           int id)
                                    throws AuthFault,
                                           ServerFault
Description copied from interface: IUser
Get encrypted password. Only global admin may do this.

Specified by:
getEncryptPassword in interface IUser
Returns:
Throws:
AuthFault
ServerFault

getMyGroups

public ResultList<Group> getMyGroups(AccessToken token,
                                     int id)
                              throws AuthFault,
                                     ServerFault
Description copied from interface: IUser
Get user direct membership groups list excluding profile groups

Specified by:
getMyGroups in interface IUser
Parameters:
token - bm-core token
id - user ID
Returns:
membership groups list
Throws:
AuthFault
ServerFault

getAllMyGroups

public ResultList<Group> getAllMyGroups(AccessToken token,
                                        int id)
                                 throws AuthFault,
                                        ServerFault
Description copied from interface: IUser
Get user membership groups hierarchy list, excluding profile groups.

Specified by:
getAllMyGroups in interface IUser
Parameters:
token - bm-core token
id - user ID
Returns:
membership groups list
Throws:
AuthFault
ServerFault

getDomainUsersExtId

public java.util.Set<java.lang.String> getDomainUsersExtId(AccessToken at,
                                                           int domainId)
                                                    throws AuthFault,
                                                           ServerFault
Description copied from interface: IUser
Get ext ID list of not archived domain users

Specified by:
getDomainUsersExtId in interface IUser
Parameters:
at - bm-core token
domainId - domain ID to get user ext ID list
Returns:
ext ID list of not archived domain users
Throws:
AuthFault
ServerFault

getUserExtIdFromLogin

public java.lang.String getUserExtIdFromLogin(AccessToken at,
                                              java.lang.String userLogin,
                                              int domainId)
                                       throws AuthFault,
                                              ServerFault
Description copied from interface: IUser
Get user ext ID from not archived user login and domain ID

Specified by:
getUserExtIdFromLogin in interface IUser
Parameters:
at - bm-core token
userLogin - user login
domainId - user domain ID
Returns:
  • user ext ID if exist and ext ID is set
  • empty string if user exist and ext ID not set
  • null if user doesn't exist
Throws:
AuthFault
ServerFault

Blue Mind
Release 1.0