Blame | Last modification | View Log | RSS feed
package in.shop2020.datalogger.event;import in.shop2020.datalogger.EventType;import org.json.JSONException;import org.json.JSONObject;public class LoginSuccess extends Event{private String source;public LoginSuccess(String[] eventFileds) {super(eventFileds);source = eventFileds[5].trim();}public LoginSuccess(EventType eType, String sessionId, long userId, String email, String[] logData) {super(eType, sessionId, userId, email);source = logData[0].trim();}public String toString() {StringBuilder sb = new StringBuilder();sb.append(eventType.name() + ", ");sb.append("userEmail : " + userEmail);sb.append(" source : " + source);sb.append(" time : " + time);sb.append(" session : " + sessionId);return sb.toString();}@Overridepublic JSONObject getLogDataInJson() {JSONObject logDataInJson = new JSONObject();try {logDataInJson.put("source", source);} catch (JSONException e) {e.printStackTrace();}return logDataInJson;}public String getSource() {return source;}public void setSource(String source) {this.source = source;}}