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
ServerFaultpublic void create(java.lang.String uid,
                   User user)
            throws ServerFault
IUserUser is created in the
 database and IUserHook implementations are invoked.create in interface IUserServerFaultpublic void createWithExtId(java.lang.String uid,
                            java.lang.String extId,
                            User user)
                     throws ServerFault
IUsercreateWithExtId in interface IUserServerFaultpublic void update(java.lang.String uid,
                   User user)
            throws ServerFault
IUserUser is updated in the
 database and IUserHook implementations are invoked.update in interface IUserServerFaultpublic ItemValue<User> getComplete(java.lang.String uid) throws ServerFault
IUserUser item from the database with its uid.getComplete in interface IUserServerFaultpublic ItemValue<User> byEmail(java.lang.String email) throws ServerFault
IUserUser item from the database with its email.byEmail in interface IUserServerFaultpublic ItemValue<User> byLogin(java.lang.String login) throws ServerFault
IUserUser item from the database with its login.byLogin in interface IUserServerFaultpublic ItemValue<User> byExtId(java.lang.String extId) throws ServerFault
IUserUser item from the database with its external ID.byExtId in interface IUserServerFaultpublic TaskRef delete(java.lang.String uid) throws ServerFault
IUserUser item from the database. IUserHook implementations are
 invoked.delete in interface IUserServerFaultpublic boolean passwordUpdateNeeded(java.lang.String login)
passwordUpdateNeeded in interface IInCoreUserpublic boolean checkPassword(java.lang.String login,
                             java.lang.String password)
checkPassword in interface IInCoreUserpublic boolean checkApiKey(java.lang.String userUid,
                           java.lang.String sid)
public java.util.List<ItemValue<Group>> memberOf(java.lang.String uid) throws ServerFault
IUserGroup a user is inmemberOf in interface IUserServerFaultpublic java.util.List<java.lang.String> memberOfGroups(java.lang.String uid)
                                                throws ServerFault
IUserGroup a user is inmemberOfGroups in interface IUserServerFaultpublic ValidationResult validate(java.lang.String[] usersUids) throws ServerFault
IInCoreGroupMembervalidate in interface IInCoreGroupMemberServerFaultpublic java.util.List<java.lang.String> allUids()
                                         throws ServerFault
IUserallUids in interface IUserServerFaultpublic void setRoles(java.lang.String uid,
                     java.util.Set<java.lang.String> roles)
              throws ServerFault
setRoles in interface IUserServerFaultpublic java.util.Set<java.lang.String> getRoles(java.lang.String uid)
                                         throws ServerFault
getRoles in interface IUserServerFaultpublic java.util.Set<java.lang.String> getResolvedRoles(java.lang.String uid)
                                                 throws ServerFault
getResolvedRoles in interface IUserServerFaultpublic java.util.Set<java.lang.String> directResolvedRoles(java.lang.String uid,
                                                           java.util.List<java.lang.String> groups)
                                                    throws ServerFault
directResolvedRoles in interface IInCoreUserServerFaultpublic java.util.Set<java.lang.String> getUsersWithRoles(java.util.List<java.lang.String> roles)
                                                  throws ServerFault
getUsersWithRoles in interface IUserServerFaultpublic void setPassword(java.lang.String uid,
                        ChangePassword password)
                 throws ServerFault
setPassword in interface IUserServerFaultpublic void updatePassword(java.lang.String uid,
                           ChangePassword password)
                    throws ServerFault
ServerFaultpublic void setPhoto(java.lang.String uid,
                     byte[] photo)
              throws ServerFault
setPhoto in interface IDirEntryPhotoSupportServerFaultpublic void deletePhoto(java.lang.String uid)
                 throws ServerFault
deletePhoto in interface IDirEntryPhotoSupportServerFaultpublic byte[] getPhoto(java.lang.String uid)
                throws ServerFault
getPhoto in interface IDirEntryPhotoSupportServerFaultpublic byte[] getIcon(java.lang.String uid)
               throws ServerFault
getIcon in interface IDirEntryPhotoSupportgetIcon in interface IUserServerFaultpublic TaskRef check(java.lang.String uid) throws ServerFault
IUser
 
 IDirEntryMaintenance.check(
        IDirEntryMaintenance.getAvailableOperations()
                .stream().map(mo -> mo.identifier)
                .collect(Collectors.toSet()));
 
 check in interface IUserServerFaultpublic TaskRef checkAndRepair(java.lang.String uid) throws ServerFault
IUserIDirEntryMaintenance.repair(Set)
 
 
 
 IDirEntryMaintenance.repair(
        IDirEntryMaintenance.getAvailableOperations()
                .stream().map(mo -> mo.identifier)
                .collect(Collectors.toSet()));
 
 checkAndRepair in interface IUserServerFaultpublic TaskRef checkAll() throws ServerFault
IUserIDirEntryMaintenance.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 IUserServerFaultpublic TaskRef checkAndRepairAll() throws ServerFault
IUserIDirEntryMaintenance.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 IUserServerFaultpublic void checkAndRepairAll(DiagnosticReport report, boolean repair, IServerTaskMonitor m) throws ServerFault
IInCoreUserrepair, 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 IInCoreUserServerFault@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 IInCoreUserServerFaultpublic void updateVCard(java.lang.String uid,
                        VCard userVCard)
                 throws ServerFault
updateVCard in interface IUserServerFaultpublic VCard getVCard(java.lang.String uid) throws ServerFault
getVCard in interface IUserServerFaultpublic void deleteUserIdentitiesForMailbox(java.lang.String mailboxUid)
                                    throws ServerFault
deleteUserIdentitiesForMailbox in interface IInCoreUserServerFaultpublic void deleteUserIdentitiesForMailbox(java.lang.String userUid,
                                           java.lang.String mailboxUid)
                                    throws ServerFault
deleteUserIdentitiesForMailbox in interface IInCoreUserServerFaultpublic void setExtId(java.lang.String uid,
                     java.lang.String extId)
              throws ServerFault
setExtId in interface IDirEntryExtIdSupportServerFaultpublic void updateAccountType(java.lang.String uid,
                              BaseDirEntry.AccountType accountType)
                       throws ServerFault
updateAccountType in interface IUserServerFaultCopyright © 2021. All Rights Reserved.