public class UserService extends java.lang.Object implements IInCoreUser, IUser
Constructor and Description |
---|
UserService(BmContext context,
ItemValue<Domain> domain,
Container container,
java.util.List<IUserHook> userHooks,
java.util.List<IPasswordUpdater> userPasswordUpdaters) |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
allUids()
Retrieve all existing
User uids |
ItemValue<User> |
byEmail(java.lang.String email)
Fetches a
User by its email |
ItemValue<User> |
byExtId(java.lang.String extId)
Fetches a
User by its external id |
ItemValue<User> |
byLogin(java.lang.String login)
Fetches a
User by its login |
boolean |
checkApiKey(java.lang.String userUid,
java.lang.String sid) |
boolean |
checkPassword(java.lang.String login,
java.lang.String password) |
void |
create(java.lang.String uid,
User user)
Creates a new
User with the given uid. |
void |
createWithExtId(java.lang.String uid,
java.lang.String extId,
User user)
Creates a new
User with the given uid. |
TaskRef |
delete(java.lang.String uid)
Deletes a
User . |
void |
deletePhoto(java.lang.String uid)
Delete the photo associated to the
DirEntry |
void |
deleteUserIdentitiesForMailbox(java.lang.String mailboxUid) |
void |
deleteUserIdentitiesForMailbox(java.lang.String userUid,
java.lang.String mailboxUid) |
java.util.Set<java.lang.String> |
directResolvedRoles(java.lang.String uid,
java.util.List<java.lang.String> groups) |
ItemValue<User> |
getComplete(java.lang.String uid)
Fetches a
User by its unique id |
byte[] |
getIcon(java.lang.String uid)
Retrieves a
User 's icon/avatar |
byte[] |
getPhoto(java.lang.String uid)
Retrieve the photo associated to the
DirEntry |
java.util.Set<java.lang.String> |
getResolvedRoles(java.lang.String uid)
Retrieves a list of all roles owned by a
User . |
java.util.Set<java.lang.String> |
getRoles(java.lang.String uid)
Retrieves a list of all roles directly owned by a
User |
java.util.Set<java.lang.String> |
getUsersWithRoles(java.util.List<java.lang.String> roles)
Retrieves a list of all
User s owning all of the provided roles |
VCard |
getVCard(java.lang.String uid)
|
java.util.List<ItemValue<Group>> |
memberOf(java.lang.String uid)
Retrieves a list of all
Group s the user is
member of. |
java.util.List<java.lang.String> |
memberOfGroups(java.lang.String uid)
Retrieves a list of all
Group uids the user is
member of. |
boolean |
passwordUpdateNeeded(java.lang.String login) |
void |
setExtId(java.lang.String uid,
java.lang.String extId)
Adds an external id to a
DirEntry |
void |
setPassword(java.lang.String uid,
ChangePassword password)
Update a
User 's password |
void |
setPhoto(java.lang.String uid,
byte[] photo)
Set a photo, needs to be in PNG format
|
void |
setRoles(java.lang.String uid,
java.util.Set<java.lang.String> roles)
Sets the
User 's roles. |
void |
update(java.lang.String uid,
User user)
Modifies an existing
User |
void |
updateAccountType(java.lang.String uid,
BaseDirEntry.AccountType accountType)
Modifies a
User 's net.bluemind.directory.api.AccountType |
void |
updatePassword(java.lang.String uid,
ChangePassword password) |
void |
updateVCard(java.lang.String uid,
VCard userVCard)
Updates a
User 's contact informations |
ValidationResult |
validate(java.lang.String[] usersUids)
Check that every uid corresponds to an existing group member
|
public UserService(BmContext context, ItemValue<Domain> domain, Container container, java.util.List<IUserHook> userHooks, java.util.List<IPasswordUpdater> userPasswordUpdaters) throws ServerFault
ServerFault
public void create(java.lang.String uid, User user) throws ServerFault
IUser
User
with the given uid. Also creates default calendar,
todo elements and the User
's mailbox if routing is internalcreate
in interface IUser
uid
- the user's unique iduser
- user dataServerFault
- standard error object (unchecked exception)public void createWithExtId(java.lang.String uid, java.lang.String extId, User user) throws ServerFault
IUser
createWithExtId
in interface IUser
uid
- the user's unique idextId
- an external id. Usually used to link the user to an external
systemuser
- user dataServerFault
- standard error objectpublic void update(java.lang.String uid, User user) throws ServerFault
IUser
User
update
in interface IUser
uid
- the user's unique iduser
- the new user valuesServerFault
- standard error object (unchecked exception)public ItemValue<User> getComplete(java.lang.String uid) throws ServerFault
IUser
User
by its unique idgetComplete
in interface IUser
uid
- the user's unique idServerFault
- standard error object (unchecked exception)public ItemValue<User> byEmail(java.lang.String email) throws ServerFault
IUser
User
by its emailbyEmail
in interface IUser
email
- the user's emailServerFault
- standard error object (unchecked exception)public ItemValue<User> byLogin(java.lang.String login) throws ServerFault
IUser
User
by its loginbyLogin
in interface IUser
login
- the user's loginServerFault
- standard error object (unchecked exception)public ItemValue<User> byExtId(java.lang.String extId) throws ServerFault
IUser
User
by its external idbyExtId
in interface IUser
extId
- the user's external idServerFault
- standard error object (unchecked exception)public TaskRef delete(java.lang.String uid) throws ServerFault
IUser
User
. Also deletes all user related objects and the user's
mailboxdelete
in interface IUser
uid
- the user's unique idServerFault
- standard error object (unchecked exception)public boolean passwordUpdateNeeded(java.lang.String login)
passwordUpdateNeeded
in interface IInCoreUser
public boolean checkPassword(java.lang.String login, java.lang.String password)
checkPassword
in interface IInCoreUser
public boolean checkApiKey(java.lang.String userUid, java.lang.String sid)
public java.util.List<ItemValue<Group>> memberOf(java.lang.String uid) throws ServerFault
IUser
Group
s the user is
member of.memberOf
in interface IUser
uid
- the user's unique idServerFault
- standard error object (unchecked exception)public java.util.List<java.lang.String> memberOfGroups(java.lang.String uid) throws ServerFault
IUser
Group
uids the user is
member of.memberOfGroups
in interface IUser
uid
- the user's unique idGroup
uidsServerFault
- standard error object (unchecked exception)public ValidationResult validate(java.lang.String[] usersUids) throws ServerFault
IInCoreGroupMember
validate
in interface IInCoreGroupMember
ServerFault
public java.util.List<java.lang.String> allUids() throws ServerFault
IUser
User
uidsallUids
in interface IUser
User
uidsServerFault
- standard error object (unchecked exception)public void setRoles(java.lang.String uid, java.util.Set<java.lang.String> roles) throws ServerFault
IUser
User
's roles. Replaces all existing role assignmentssetRoles
in interface IUser
uid
- the user's unique idroles
- a set of roles to be assigned to the userServerFault
- standard error object (unchecked exception)public java.util.Set<java.lang.String> getRoles(java.lang.String uid) throws ServerFault
IUser
User
getRoles
in interface IUser
ServerFault
- standard error object (unchecked exception)public java.util.Set<java.lang.String> getResolvedRoles(java.lang.String uid) throws ServerFault
IUser
User
. Also includes roles
indirectly assigned to the User
, for example by its
Group
membershipsgetResolvedRoles
in interface IUser
uid
- the user's unique idServerFault
- standard error object (unchecked exception)public java.util.Set<java.lang.String> directResolvedRoles(java.lang.String uid, java.util.List<java.lang.String> groups) throws ServerFault
directResolvedRoles
in interface IInCoreUser
ServerFault
public java.util.Set<java.lang.String> getUsersWithRoles(java.util.List<java.lang.String> roles) throws ServerFault
IUser
User
s owning all of the provided rolesgetUsersWithRoles
in interface IUser
roles
- a list of rolesServerFault
- standard error object (unchecked exception)public void setPassword(java.lang.String uid, ChangePassword password) throws ServerFault
IUser
User
's passwordsetPassword
in interface IUser
uid
- user's unique idpassword
- object containing the current and new passwordServerFault
- standard error object (unchecked exception)public void updatePassword(java.lang.String uid, ChangePassword password) throws ServerFault
ServerFault
public void setPhoto(java.lang.String uid, byte[] photo) throws ServerFault
IDirEntryPhotoSupport
setPhoto
in interface IDirEntryPhotoSupport
uid
- the directory entry uidphoto
- the photo dataServerFault
- common error objectpublic void deletePhoto(java.lang.String uid) throws ServerFault
IDirEntryPhotoSupport
DirEntry
deletePhoto
in interface IDirEntryPhotoSupport
uid
- the directory entry uidServerFault
- common error objectpublic byte[] getPhoto(java.lang.String uid) throws ServerFault
IDirEntryPhotoSupport
DirEntry
getPhoto
in interface IDirEntryPhotoSupport
uid
- the directory entry uidServerFault
- common error objectpublic byte[] getIcon(java.lang.String uid) throws ServerFault
IUser
User
's icon/avatargetIcon
in interface IDirEntryPhotoSupport
getIcon
in interface IUser
uid
- user's unique idServerFault
- standard error object (unchecked exception)public void updateVCard(java.lang.String uid, VCard userVCard) throws ServerFault
IUser
User
's contact informationsupdateVCard
in interface IUser
uid
- user's unique iduserVCard
- the new contact informationsServerFault
- standard error object (unchecked exception)public VCard getVCard(java.lang.String uid) throws ServerFault
IUser
getVCard
in interface IUser
uid
- user's unique idServerFault
- standard error object (unchecked exception)public void deleteUserIdentitiesForMailbox(java.lang.String mailboxUid) throws ServerFault
deleteUserIdentitiesForMailbox
in interface IInCoreUser
ServerFault
public void deleteUserIdentitiesForMailbox(java.lang.String userUid, java.lang.String mailboxUid) throws ServerFault
deleteUserIdentitiesForMailbox
in interface IInCoreUser
ServerFault
public void setExtId(java.lang.String uid, java.lang.String extId) throws ServerFault
IDirEntryExtIdSupport
DirEntry
setExtId
in interface IDirEntryExtIdSupport
uid
- the DirEntryQuery
's UIDextId
- the external idServerFault
- common error objectpublic void updateAccountType(java.lang.String uid, BaseDirEntry.AccountType accountType) throws ServerFault
IUser
User
's net.bluemind.directory.api.AccountType
updateAccountType
in interface IUser
uid
- user's unique idaccountType
- the new account typeServerFault
- standard error object (unchecked exception)Copyright © 2021. All Rights Reserved.