| 167 |
ashish |
1 |
package in.shop2020.hotspot.dashbaord.server.handler;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.hotspot.dashbaord.shared.actions.AuthRequest;
|
|
|
4 |
import in.shop2020.hotspot.dashbaord.shared.actions.AuthResponse;
|
|
|
5 |
import net.customware.gwt.dispatch.server.ActionHandler;
|
|
|
6 |
import net.customware.gwt.dispatch.server.ExecutionContext;
|
|
|
7 |
import net.customware.gwt.dispatch.shared.ActionException;
|
|
|
8 |
|
|
|
9 |
public class AuthHandler implements ActionHandler<AuthRequest, AuthResponse>{
|
|
|
10 |
|
|
|
11 |
@Override
|
|
|
12 |
public AuthResponse execute(AuthRequest request, ExecutionContext response)
|
|
|
13 |
throws ActionException {
|
|
|
14 |
String userName = request.getUsername();
|
|
|
15 |
|
|
|
16 |
if (userName.trim().toUpperCase().equals("SHOP2020")){
|
|
|
17 |
return new AuthResponse(userName, true, " You are charming, loving and affectionate");
|
|
|
18 |
}
|
|
|
19 |
else
|
|
|
20 |
return new AuthResponse(userName, false, "None");
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
@Override
|
|
|
24 |
public Class<AuthRequest> getActionType() {
|
|
|
25 |
|
|
|
26 |
return AuthRequest.class;
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
@Override
|
|
|
30 |
public void rollback(AuthRequest arg0, AuthResponse arg1,
|
|
|
31 |
ExecutionContext arg2) throws ActionException {
|
|
|
32 |
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
}
|