public class UserService extends java.lang.Object implements IInCoreUser, IUser
IUser.DiagnosticReportCheckId
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()
Returns all the items uid from the container
|
ItemValue<User> |
byEmail(java.lang.String email)
Fetches a
User item from the database with its email. |
ItemValue<User> |
byExtId(java.lang.String extId)
Fetches a
User item from the database with its external ID. |
ItemValue<User> |
byLogin(java.lang.String login)
Fetches a
User item from the database with its login. |
TaskRef |
check(java.lang.String uid)
Use IDirEntryMaintenance
|
TaskRef |
checkAll()
|
TaskRef |
checkAndRepair(java.lang.String uid)
|
void |
checkAndRepair(java.lang.String uid,
DiagnosticReport report,
boolean repair,
IServerTaskMonitor monitor)
Deprecated.
|
TaskRef |
checkAndRepairAll()
|
void |
checkAndRepairAll(DiagnosticReport report,
boolean repair,
IServerTaskMonitor m)
|
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)
Create user with external ID
|
TaskRef |
delete(java.lang.String uid)
Deletes a
User item from the database. |
void |
deletePhoto(java.lang.String uid) |
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 item from the database with its uid. |
byte[] |
getIcon(java.lang.String uid) |
byte[] |
getPhoto(java.lang.String uid) |
java.util.Set<java.lang.String> |
getResolvedRoles(java.lang.String uid) |
java.util.Set<java.lang.String> |
getRoles(java.lang.String uid) |
java.util.Set<java.lang.String> |
getUsersWithRoles(java.util.List<java.lang.String> roles) |
VCard |
getVCard(java.lang.String uid) |
java.util.List<ItemValue<Group>> |
memberOf(java.lang.String uid)
Returns the list of
Group a user is in |
java.util.List<java.lang.String> |
memberOfGroups(java.lang.String uid)
Returns the list of
Group a user is in |
boolean |
passwordUpdateNeeded(java.lang.String login) |
void |
setExtId(java.lang.String uid,
java.lang.String extId) |
void |
setPassword(java.lang.String uid,
ChangePassword password) |
void |
setPhoto(java.lang.String uid,
byte[] photo) |
void |
setRoles(java.lang.String uid,
java.util.Set<java.lang.String> roles) |
void |
update(java.lang.String uid,
User user)
Modifies a user with the given uid.
|
void |
updateAccountType(java.lang.String uid,
BaseDirEntry.AccountType accountType) |
void |
updatePassword(java.lang.String uid,
ChangePassword password) |
void |
updateVCard(java.lang.String uid,
VCard userVCard) |
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
is created in the
database and IUserHook implementations are invoked.create
in interface IUser
ServerFault
public void createWithExtId(java.lang.String uid, java.lang.String extId, User user) throws ServerFault
IUser
createWithExtId
in interface IUser
ServerFault
public void update(java.lang.String uid, User user) throws ServerFault
IUser
User
is updated in the
database and IUserHook implementations are invoked.update
in interface IUser
ServerFault
public ItemValue<User> getComplete(java.lang.String uid) throws ServerFault
IUser
User
item from the database with its uid.getComplete
in interface IUser
ServerFault
public ItemValue<User> byEmail(java.lang.String email) throws ServerFault
IUser
User
item from the database with its email.byEmail
in interface IUser
ServerFault
public ItemValue<User> byLogin(java.lang.String login) throws ServerFault
IUser
User
item from the database with its login.byLogin
in interface IUser
ServerFault
public ItemValue<User> byExtId(java.lang.String extId) throws ServerFault
IUser
User
item from the database with its external ID.byExtId
in interface IUser
ServerFault
public TaskRef delete(java.lang.String uid) throws ServerFault
IUser
User
item from the database. IUserHook implementations are
invoked.delete
in interface IUser
ServerFault
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
a user is inmemberOf
in interface IUser
ServerFault
public java.util.List<java.lang.String> memberOfGroups(java.lang.String uid) throws ServerFault
IUser
Group
a user is inmemberOfGroups
in interface IUser
ServerFault
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
allUids
in interface IUser
ServerFault
public void setRoles(java.lang.String uid, java.util.Set<java.lang.String> roles) throws ServerFault
setRoles
in interface IUser
ServerFault
public java.util.Set<java.lang.String> getRoles(java.lang.String uid) throws ServerFault
getRoles
in interface IUser
ServerFault
public java.util.Set<java.lang.String> getResolvedRoles(java.lang.String uid) throws ServerFault
getResolvedRoles
in interface IUser
ServerFault
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
getUsersWithRoles
in interface IUser
ServerFault
public void setPassword(java.lang.String uid, ChangePassword password) throws ServerFault
setPassword
in interface IUser
ServerFault
public void updatePassword(java.lang.String uid, ChangePassword password) throws ServerFault
ServerFault
public void setPhoto(java.lang.String uid, byte[] photo) throws ServerFault
setPhoto
in interface IDirEntryPhotoSupport
ServerFault
public void deletePhoto(java.lang.String uid) throws ServerFault
deletePhoto
in interface IDirEntryPhotoSupport
ServerFault
public byte[] getPhoto(java.lang.String uid) throws ServerFault
getPhoto
in interface IDirEntryPhotoSupport
ServerFault
public byte[] getIcon(java.lang.String uid) throws ServerFault
getIcon
in interface IDirEntryPhotoSupport
getIcon
in interface IUser
ServerFault
public TaskRef check(java.lang.String uid) throws ServerFault
IUser
IDirEntryMaintenance.check(
IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet()));
check
in interface IUser
ServerFault
public TaskRef checkAndRepair(java.lang.String uid) throws ServerFault
IUser
IDirEntryMaintenance.repair(Set)
IDirEntryMaintenance.repair(
IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet()));
checkAndRepair
in interface IUser
ServerFault
public TaskRef checkAll() throws ServerFault
IUser
IDirEntryMaintenance.check(Set)
Set<String>
opsIds = IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet());
for (String userUid: IUser.allUids()) {
IDirEntryMaintenance.check(opsIds);
}
checkAll
in interface IUser
ServerFault
public TaskRef checkAndRepairAll() throws ServerFault
IUser
IDirEntryMaintenance.repair(Set)
Set<String>
opsIds = IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet());
for (String userUid: IUser.allUids()) {
IDirEntryMaintenance.repair(opsIds);
}
checkAndRepairAll
in interface IUser
ServerFault
public void checkAndRepairAll(DiagnosticReport report, boolean repair, IServerTaskMonitor m) throws ServerFault
IInCoreUser
repair
, use IDirEntryMaintenance.check(Set)
If repair
, use
IDirEntryMaintenance.repair(Set)
Set<String>
opsIds = IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet());
for (String userUid: IUser.allUids()) {
if (repair) {
IDirEntryMaintenance.repair(opsIds);
} else {
IDirEntryMaintenance.check(opsIds);
}
}
checkAndRepairAll
in interface IInCoreUser
ServerFault
@Deprecated public void checkAndRepair(java.lang.String uid, DiagnosticReport report, boolean repair, IServerTaskMonitor monitor) throws ServerFault
repair
, use IDirEntryMaintenance.check(Set)
If
repair
, use IDirEntryMaintenance.repair(Set)
if (repair) {
IDirEntryMaintenance.repair(
IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet()));
} else {
IDirEntryMaintenance.check(
IDirEntryMaintenance.getAvailableOperations()
.stream().map(mo -> mo.identifier)
.collect(Collectors.toSet()));
}
checkAndRepair
in interface IInCoreUser
ServerFault
public void updateVCard(java.lang.String uid, VCard userVCard) throws ServerFault
updateVCard
in interface IUser
ServerFault
public VCard getVCard(java.lang.String uid) throws ServerFault
getVCard
in interface IUser
ServerFault
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
setExtId
in interface IDirEntryExtIdSupport
ServerFault
public void updateAccountType(java.lang.String uid, BaseDirEntry.AccountType accountType) throws ServerFault
updateAccountType
in interface IUser
ServerFault
Copyright © 2021. All Rights Reserved.