-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoalTrigger.java
More file actions
86 lines (65 loc) · 2.71 KB
/
Copy pathGoalTrigger.java
File metadata and controls
86 lines (65 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//$Id$
package com.zoho.abtest.report;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.adventnet.ds.query.Column;
import com.adventnet.ds.query.Criteria;
import com.adventnet.ds.query.QueryConstants;
import com.adventnet.persistence.DataAccessException;
import com.adventnet.persistence.DataObject;
import com.adventnet.persistence.Row;
import com.zoho.abtest.GOAL_TRIGGER;
import com.zoho.abtest.common.ZABModel;
import com.zoho.abtest.exception.ZABException;
import com.zoho.abtest.goal.Goal;
import com.zoho.abtest.trigger.Trigger;
import com.zoho.abtest.utility.ZABUtil;
import com.zoho.abtest.webhook.Webhook;
public class GoalTrigger extends CustomTrigger {
private static final Logger LOGGER = Logger.getLogger(GoalTrigger.class.getName());
private static final long serialVersionUID = 1L;
// public ArrayList<Webhook> getWebhooks(WebhookWrapper wrapper) throws Exception{
// ArrayList<Webhook> al=null;
// try{
// HashMap<String,String> h=wrapper.getWrapper().getExperimentsData().get(0);
// String portal = h.get(ReportRawDataConstants.PORTAL);
// String goalLnName = h.get(ReportRawDataConstants.GOAL_LINK_NAME);
// ZABUtil.setDBSpaceByPortal(portal);
// Long goalid = Goal.getGoalIdForGoal(goalLnName);
// Criteria c = new Criteria(new Column(GOAL_TRIGGER.TABLE,GOAL_TRIGGER.GOAL_ID),goalid, QueryConstants.EQUAL, Boolean.FALSE);
// DataObject dobj=getRow(GOAL_TRIGGER.TABLE,c);
// Iterator it =dobj.getRows(GOAL_TRIGGER.TABLE);
// while(it.hasNext()){
// Row row= (Row)it.next();
// Long triggerid=(Long)row.get(GOAL_TRIGGER.TRIGGER_ID);
// long webhookid=Trigger.getWebhookIdByTriggerId(triggerid);
// Webhook webhook=Webhook.getWebhookById(webhookid);
// webhook.setSystem(false);
// al.add(webhook);
//
// }
// }
// catch(Exception e){
// LOGGER.log(Level.SEVERE, e.getMessage(),e);
// return null;
// }
// return al;
// }
//
public HashMap<String ,String> getVariables(WebhookWrapper wrapper){
HashMap<String,String> userAgenths=new HashMap();
try{
userAgenths.put("PORTAL", wrapper.getWrapper().getExperimentsData().get(0).get(ReportRawDataConstants.PORTAL));
userAgenths.put("BROWSER", wrapper.getWrapper().getUserAgenths().get(ReportRawDataConstants.BROWSER_VALUE));
userAgenths.put("OS",wrapper.getWrapper().getUserAgenths().get(ReportRawDataConstants.OS_VALUE));
userAgenths.put("DEVICE", wrapper.getWrapper().getUserAgenths().get(ReportRawDataConstants.DEVICE_VALUE));
}
catch(Exception ex){
LOGGER.log(Level.SEVERE, ex.getMessage(),ex);
}
return userAgenths;
}
}