Package de.xima.fc.api.entity
Class BenutzerAPI
- java.lang.Object
-
- de.xima.fc.api.ASubAPI
-
- de.xima.fc.api.entity.AEntityAPI<Benutzer>
-
- de.xima.fc.api.entity.BenutzerAPI
-
public class BenutzerAPI extends AEntityAPI<Benutzer>
API class for manipulation ofBenutzer
entities.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from class de.xima.fc.api.entity.AEntityAPI
entityClass
-
-
Constructor Summary
Constructors Constructor Description BenutzerAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addBenutzerToGruppe(UserContext uc, Benutzer ben, BenutzerGruppe bg)
Method to add a user to a user group.Benutzer
byLDAPGruppe(UserContext uc, String username, Mandant mandant)
Benutzer
byLDAPGruppeLogin(UserContext uc, Mandant man, String username, String clearTextPassword)
Benutzer
byLogin(UserContext uc, String username, String clearTextPassword, Mandant mandant)
Method for determining a user based on his login data.Benutzer
byNameAndMandant(UserContext uc, String username, Mandant mandant)
Benutzer
checkLDAPGroupsActiveUser(UserContext uc, Long clientId, String userName)
boolean
checkLDAPLogin(UserContext uc, Mandant man, String username, String clearTextPassword)
Method for determining a user based on his LDAP login.Boolean
checkLogin(UserContext uc, String username, String clearTextPassword, Mandant man)
Method for checking login data of a user.String
generatePassword()
List<BenutzerGruppe>
getBenutzergruppen(UserContext uc, Benutzer ben)
Method for determining all user groups of a user.Benutzer
getByLDAPData(UserContext uc, Mandant mandant, String userName, byte[] objectID)
List<Benutzer>
getByMandant(UserContext uc, Mandant mandant)
Method for determining all user of aMandant
.Benutzer
getByUUID(UserContext uc, Mandant client, String uuid)
Returns the user with the given UUID stringBenutzer
getByUUID(UserContext uc, Mandant client, UUID uuid)
Returns the user with the given UUIDcom.alibaba.fastjson.JSONObject
getLDAPUserData(UserContext uc, Benutzer benutzer)
UserAccess
getUserAccess(Mandant client)
Creates an useraccess based on an clientUserAccess
getUserAccess(LicenseAccess licenseAccess)
Creates an useraccess based on an license accessBenutzer
handleUserLogin(UserContext uc, Benutzer user)
Method to register an successful user-loginboolean
isLDAPUserActive(UserContext uc, Mandant man, String username)
Benutzer
registerBenutzer(UserContext uc, Benutzer benutzer, Mandant mandant)
Method for creating a new user for aMandant
.-
Methods inherited from class de.xima.fc.api.entity.AEntityAPI
create, create, delete, delete, deleteAllBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getSingleAttributes, getSingleAttributes, resultTotalCount, resultTotalCount, update, update
-
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
-
-
-
Method Detail
-
checkLogin
public Boolean checkLogin(UserContext uc, String username, String clearTextPassword, Mandant man)
Method for checking login data of a user.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.username
-String
the user name.clearTextPassword
-String
the password of a user.man
-Mandant
to which the user is assigned.- Returns:
Boolean
whether the user could log-in.- Since:
- 2.4.3
-
checkLDAPLogin
public boolean checkLDAPLogin(UserContext uc, Mandant man, String username, String clearTextPassword)
Method for determining a user based on his LDAP login.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.man
-Mandant
to which the user is assigned.username
-String
the user name.clearTextPassword
-String
the password of the user.- Returns:
Boolean
whether the user could log-in.
-
isLDAPUserActive
public boolean isLDAPUserActive(UserContext uc, Mandant man, String username)
-
checkLDAPGroupsActiveUser
public Benutzer checkLDAPGroupsActiveUser(UserContext uc, Long clientId, String userName)
- Parameters:
uc
-UserContext
the user context in which the action is to be performed.clientId
-Long
the id of the clientuserName
-String
the name of the user- Returns:
Boolean
if the LDAP-user is active
-
handleUserLogin
public Benutzer handleUserLogin(UserContext uc, Benutzer user)
Method to register an successful user-login- Parameters:
uc
-UserContext
the user context in which the action is to be performed.user
-Benutzer
which should be checked.- Returns:
- The found
Benutzer
.
-
getByMandant
public List<Benutzer> getByMandant(UserContext uc, Mandant mandant)
Method for determining all user of aMandant
.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.mandant
-Mandant
whose users are to be determined.- Returns:
List
the foundBenutzer
of aMandant
.- Since:
- 2.4.3
-
byLogin
public Benutzer byLogin(UserContext uc, String username, String clearTextPassword, Mandant mandant)
Method for determining a user based on his login data.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.username
-String
the user name.clearTextPassword
-String
the password of the user.mandant
-Mandant
to which the user is assigned.- Returns:
Benutzer
which can be registered with the committed data ornull
.- Since:
- 2.4.3
-
byLDAPGruppeLogin
public Benutzer byLDAPGruppeLogin(UserContext uc, Mandant man, String username, String clearTextPassword)
-
byNameAndMandant
public Benutzer byNameAndMandant(UserContext uc, String username, Mandant mandant)
-
byLDAPGruppe
public Benutzer byLDAPGruppe(UserContext uc, String username, Mandant mandant)
-
getByLDAPData
public Benutzer getByLDAPData(UserContext uc, Mandant mandant, String userName, byte[] objectID)
-
getLDAPUserData
public com.alibaba.fastjson.JSONObject getLDAPUserData(UserContext uc, Benutzer benutzer)
-
getBenutzergruppen
public List<BenutzerGruppe> getBenutzergruppen(UserContext uc, Benutzer ben)
Method for determining all user groups of a user.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.ben
-Benutzer
the user whose groups are searched.- Returns:
List
ofBenutzer
.- Since:
- 2.4.3
-
getByUUID
public Benutzer getByUUID(UserContext uc, Mandant client, String uuid)
Returns the user with the given UUID string- Parameters:
uc
-UserContext
to useclient
-Mandant
context in which to look for useruuid
-String
UUID string of the user- Returns:
Benutzer
for the given UUID and client- Since:
- 6.x.x
-
getByUUID
public Benutzer getByUUID(UserContext uc, Mandant client, UUID uuid)
Returns the user with the given UUID- Parameters:
uc
-UserContext
to useclient
-Mandant
context in which to look for useruuid
-UUID
UUID of the user- Returns:
Benutzer
for the given UUID and client- Since:
- 6.x.x
-
addBenutzerToGruppe
public boolean addBenutzerToGruppe(UserContext uc, Benutzer ben, BenutzerGruppe bg)
Method to add a user to a user group.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.ben
- theBenutzer
to which the group should be added.bg
- theBenutzerGruppe
to be added to the user.- Returns:
true
if the update was successful.- Since:
- 2.4.3
-
registerBenutzer
public Benutzer registerBenutzer(UserContext uc, Benutzer benutzer, Mandant mandant)
Method for creating a new user for aMandant
.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.benutzer
-Benutzer
to be created.mandant
-Mandant
to be assigned to the user.- Returns:
true
if the user was created successfully.
-
generatePassword
public String generatePassword()
-
getUserAccess
public UserAccess getUserAccess(LicenseAccess licenseAccess)
Creates an useraccess based on an license access- Parameters:
licenseAccess
- the license access- Returns:
- the useraccess
-
getUserAccess
public UserAccess getUserAccess(Mandant client)
Creates an useraccess based on an client- Parameters:
client
- the client- Returns:
- the useraccess
-
-