RMI Crawler->JMX Crawler
This commit is contained in:
parent
977b5494f9
commit
e20b9e33c8
|
@ -0,0 +1,16 @@
|
||||||
|
package com.loafle.overflow.module.member.exception;
|
||||||
|
|
||||||
|
import com.loafle.overflow.commons.exception.OverflowRuntimeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by geek on 17. 11. 23.
|
||||||
|
*/
|
||||||
|
public class SigninOverFailedException extends OverflowRuntimeException {
|
||||||
|
public SigninOverFailedException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public SigninOverFailedException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,6 +21,7 @@ public class Member {
|
||||||
private String companyName;
|
private String companyName;
|
||||||
private Date createDate;
|
private Date createDate;
|
||||||
private MetaMemberStatus status;
|
private MetaMemberStatus status;
|
||||||
|
private int signinFailCount;
|
||||||
|
|
||||||
public Member() {
|
public Member() {
|
||||||
}
|
}
|
||||||
|
@ -110,5 +111,13 @@ public class Member {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Column(name = "SIGNIN_FAIL_COUNT", nullable = true, columnDefinition = "int default 0")
|
||||||
|
public int getSigninFailCount(){
|
||||||
|
return this.signinFailCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSigninFailCount(int failCount) {
|
||||||
|
this.signinFailCount = failCount;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class MemberService {
|
||||||
|
|
||||||
private BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
private BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||||
|
|
||||||
public Member signin(String signinId, String signinPw) throws SignInIdNotExistException, EmailNotConfirmedException, SignInPwNotMatchException {
|
public Member signin(String signinId, String signinPw) {
|
||||||
Member m = this.memberDAO.findByEmail(signinId);
|
Member m = this.memberDAO.findByEmail(signinId);
|
||||||
|
|
||||||
if ( null == m ) {
|
if ( null == m ) {
|
||||||
|
@ -65,9 +65,18 @@ public class MemberService {
|
||||||
|
|
||||||
Boolean match = passwordEncoder.matches(signinPw, m.getPw());
|
Boolean match = passwordEncoder.matches(signinPw, m.getPw());
|
||||||
if(!match) {
|
if(!match) {
|
||||||
|
if (m.getSigninFailCount() > 10) {
|
||||||
|
throw new SigninOverFailedException("Login failed 10 times");
|
||||||
|
}
|
||||||
|
m.setSigninFailCount(m.getSigninFailCount()+1);
|
||||||
|
this.modify(m);
|
||||||
throw new SignInPwNotMatchException();
|
throw new SignInPwNotMatchException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.setSigninFailCount(0);
|
||||||
|
this.modify(m);
|
||||||
|
|
||||||
|
// Todo Signin History
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +88,6 @@ public class MemberService {
|
||||||
throw new JoinedEmailException();
|
throw new JoinedEmailException();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo Password Check
|
|
||||||
boolean checkPass = this.isPasswordStrong(pw);
|
boolean checkPass = this.isPasswordStrong(pw);
|
||||||
|
|
||||||
if (!checkPass) {
|
if (!checkPass) {
|
||||||
|
@ -147,7 +155,7 @@ public class MemberService {
|
||||||
}
|
}
|
||||||
member.setPw(passwordEncoder.encode(pw));
|
member.setPw(passwordEncoder.encode(pw));
|
||||||
|
|
||||||
return this.memberDAO.save(member);
|
return this.modify(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void signout(Member member) {
|
public void signout(Member member) {
|
||||||
|
@ -180,6 +188,10 @@ public class MemberService {
|
||||||
if (member.getStatus() == null || member.getStatus().getId() < 0) {
|
if (member.getStatus() == null || member.getStatus().getId() < 0) {
|
||||||
member.getStatus().setId(preMember.getStatus().getId());
|
member.getStatus().setId(preMember.getStatus().getId());
|
||||||
}
|
}
|
||||||
|
return this.modify(member);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Member modify(Member member) {
|
||||||
return this.memberDAO.save(member);
|
return this.memberDAO.save(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user