Subversion Repositories SmartDukaan

Rev

Rev 2262 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2262 vikas 1
package in.shop2020.datalogger.event;
2
 
2418 vikas 3
import in.shop2020.datalogger.EventType;
4
 
5
import org.json.JSONException;
6
import org.json.JSONObject;
7
 
2262 vikas 8
public class RegisterDataIncomplete extends Event{
9
 
10
    private String userName;
11
    private String commMail;
12
 
13
    public RegisterDataIncomplete(String[] eventFileds) {
14
        super(eventFileds);
15
        userName = eventFileds[5].trim();
16
        commMail = eventFileds[6].trim();
17
    }
18
 
2418 vikas 19
    public RegisterDataIncomplete(EventType eType, String sessionId, long userId, String email, String[] logData) {
20
        super(eType, sessionId, userId, email);
21
        userName = logData[0].trim();
22
        commMail = logData[1].trim();
23
    }
24
 
2262 vikas 25
    public String toString() {
26
        StringBuilder sb = new StringBuilder();
27
        sb.append(eventType.name() + ", ");
28
        sb.append("userEmail : " + userEmail);
29
        sb.append(" userName : " + userName);
30
        sb.append(" commMail : " + commMail);
31
        sb.append(" time : " + time);
32
        sb.append(" session : " + sessionId);
33
 
34
        return sb.toString();
35
    }
36
 
2418 vikas 37
    @Override
38
    public JSONObject getLogDataInJson() {
39
        JSONObject logDataInJson = new JSONObject();
40
        try {
41
            logDataInJson.put("userName", userName);
42
            logDataInJson.put("commMail", commMail);
43
        } catch (JSONException e) {
44
            e.printStackTrace();
45
        }
46
        return logDataInJson;
47
    }
48
 
2262 vikas 49
    public String getUserName() {
50
        return userName;
51
    }
52
 
53
    public void setUserName(String userName) {
54
        this.userName = userName;
55
    }
56
 
57
    public String getCommMail() {
58
        return commMail;
59
    }
60
 
61
    public void setCommMail(String commMail) {
62
        this.commMail = commMail;
63
    }
64
}