Package com.easydesk.security.adaptor
Class UserManagerAdaptor<U extends User>
java.lang.Object
com.easydesk.security.adaptor.UserManagerAdaptor<U>
- Type Parameters:
U- User type
- All Implemented Interfaces:
SecurityEntityManager<User,,Long> UserManager,Serializable
Torque OM(
EasyDeskUserImpl) 을 이용하여 사용자를 관리하는 UserManager 구현.
password 의 변환과 검증은 주입받은 CredentialService 에 위임한다.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUserManagerAdaptor(CredentialService credentialService) CredentialService 를 주입받아 UserManagerAdaptor 를 생성한다. -
Method Summary
Modifier and TypeMethodDescription새 사용자를 저장소에 추가한다.voidauthenticate(User user, String plainTextPassword) Authenticate an User with the specified password.voidchangePassword(User user, String oldPassword, String newPassword) Change the password for an User.booleanid 로 사용자가 저장소에 존재하는지 확인한다.booleanlogin 이름에 해당하는 사용자가 저장소에 존재하는지 확인한다.voidforcePassword(User user, String password) Forcibly sets new password for an User.사용자의 User-Group-Role 정보로 AccessControlList 를 생성한다.User[]login 이름에 해당하는 사용자를 구한다.새 사용자 instance 를 생성한다.getInstance(Long id) id 에 해당하는 사용자를 구한다.void사용자를 저장소에서 삭제한다.void사용자 이름 변경은 지원하지 않는다.retrieveUserList(Object criteria) 조건에 맞는 사용자 목록을 구한다.voidSaves User's data in the permanent storage.
-
Constructor Details
-
UserManagerAdaptor
CredentialService 를 주입받아 UserManagerAdaptor 를 생성한다.- Parameters:
credentialService- password 변환과 검증에 사용하는 CredentialService
-
-
Method Details
-
getInstance
새 사용자 instance 를 생성한다. 저장소에 저장하지는 않는다.- Specified by:
getInstancein interfaceSecurityEntityManager<User,Long> - Returns:
- 새 EasyDeskUserImpl
-
getInstance
id 에 해당하는 사용자를 구한다.- Specified by:
getInstancein interfaceSecurityEntityManager<User,Long> - Parameters:
id- user id- Returns:
- id 에 해당하는 사용자
- Throws:
DataBackendException- 저장소 접근 중 오류가 발생한 경우UnknownEntityException- id 에 해당하는 사용자가 없는 경우
-
getByName
login 이름에 해당하는 사용자를 구한다.- Specified by:
getByNamein interfaceSecurityEntityManager<User,Long> - Parameters:
name- login 이름- Returns:
- login 이름에 해당하는 사용자
- Throws:
DataBackendException- 저장소 접근 중 오류가 발생한 경우UnknownEntityException- 이름에 해당하는 사용자가 없는 경우
-
rename
사용자 이름 변경은 지원하지 않는다.- Specified by:
renamein interfaceSecurityEntityManager<User,Long> - Parameters:
entity- 대상 사용자name- 새 이름- Throws:
DataBackendException- 발생하지 않는다UnknownEntityException- 발생하지 않는다UnsupportedOperationException- 항상 발생 (지원하지 않음)
-
remove
사용자를 저장소에서 삭제한다.- Specified by:
removein interfaceSecurityEntityManager<User,Long> - Parameters:
entity- 삭제할 사용자- Throws:
DataBackendException- 삭제 중 오류가 발생한 경우UnknownEntityException- 사용자가 존재하지 않는 경우
-
add
새 사용자를 저장소에 추가한다. 입력한 password 를 CredentialService 로 변환하여 저장한다.- Specified by:
addin interfaceSecurityEntityManager<User,Long> - Parameters:
entity- 추가할 사용자 (id 가 없어야 하며, password 는 plain text)- Returns:
- 저장된 사용자
- Throws:
DataBackendException- password 변환 또는 저장 중 오류가 발생한 경우EntityExistsException- id 가 이미 있거나 같은 이름의 사용자가 존재하는 경우
-
exists
id 로 사용자가 저장소에 존재하는지 확인한다.- Specified by:
existsin interfaceSecurityEntityManager<User,Long> - Parameters:
entity- 확인할 사용자- Returns:
- 존재하면
true, 조회 중 오류가 발생하면false - Throws:
DataBackendException- 저장소 접근 중 오류가 발생한 경우
-
exists
login 이름에 해당하는 사용자가 저장소에 존재하는지 확인한다.- Specified by:
existsin interfaceSecurityEntityManager<User,Long> - Parameters:
name- 확인할 login 이름- Returns:
- 존재하면
true - Throws:
DataBackendException- 저장소 접근 중 오류가 발생한 경우
-
retrieveUserList
조건에 맞는 사용자 목록을 구한다. 현재는 지원하지 않는다.- Specified by:
retrieveUserListin interfaceUserManager- Type Parameters:
T- User type- Parameters:
criteria- torque criteria- Returns:
- 사용자 목록
- Throws:
DataBackendException- 발생하지 않는다UnsupportedOperationException- 항상 발생 (미구현)
-
saveUser
Saves User's data in the permanent storage. The user account is required to exist in the storage.- Specified by:
saveUserin interfaceUserManager- Parameters:
user- the user object to save- Throws:
UnknownEntityException- if the user's account does not exist in the database.DataBackendException- if there is a problem accessing the storage.
-
authenticate
public void authenticate(User user, String plainTextPassword) throws PasswordMismatchException, UnknownEntityException, DataBackendException Authenticate an User with the specified password. If authentication is successful the method returns nothing. If there are any problems, exception was thrown.사용자 id 가 있으면 id 로, 없으면 이름으로 존재 여부를 확인한 뒤 CredentialService 로 password 를 검증한다.
- Specified by:
authenticatein interfaceUserManager- Parameters:
user- an User object to authenticate.plainTextPassword- the user supplied password.- Throws:
PasswordMismatchException- if the supplied password was incorrect.UnknownEntityException- if the user's record does not exist in the database.DataBackendException- if there is a problem accessing the storage.
-
changePassword
public void changePassword(User user, String oldPassword, String newPassword) throws PasswordMismatchException, UnknownEntityException, DataBackendException Change the password for an User. 현재 password 를 검증한 후 새 password 로 변경한다.- Specified by:
changePasswordin interfaceUserManager- Parameters:
user- an User to change password for.oldPassword- the current password suplied by the user.newPassword- the new password requested by the user.- Throws:
PasswordMismatchException- if the supplied password was incorrect.UnknownEntityException- if the user's record does not exist in the database.DataBackendException- if there is a problem accessing the storage.
-
forcePassword
public void forcePassword(User user, String password) throws UnknownEntityException, DataBackendException Forcibly sets new password for an User.This is supposed by the administrator to change the forgotten or compromised passwords. Certain implementatations of this feature would require administrative level access to the authenticating server / program. 새 password 를 CredentialService 로 변환하여 저장한다.
- Specified by:
forcePasswordin interfaceUserManager- Parameters:
user- an User to change password for.password- the new password. (plain text)- Throws:
UnknownEntityException- if the user's record does not exist in the database.DataBackendException- if there is a problem accessing the storage.
-
getACL
사용자의 User-Group-Role 정보로 AccessControlList 를 생성한다.- Specified by:
getACLin interfaceUserManager- Parameters:
user- the user- Returns:
- 사용자의 EasyDeskAccessControlListImpl
- Throws:
UnknownEntityException- if the implementation of ACL interface could not be determined, or does not exist.
-