| Line 12... |
Line 12... |
| 12 |
|
12 |
|
| 13 |
import java.util.ArrayList;
|
13 |
import java.util.ArrayList;
|
| 14 |
import java.util.HashMap;
|
14 |
import java.util.HashMap;
|
| 15 |
import java.util.List;
|
15 |
import java.util.List;
|
| 16 |
import java.util.Map;
|
16 |
import java.util.Map;
|
| 17 |
import java.util.Map.Entry;
|
- |
|
| 18 |
|
17 |
|
| 19 |
import javax.mail.internet.AddressException;
|
18 |
import javax.mail.internet.AddressException;
|
| 20 |
import javax.mail.internet.InternetAddress;
|
19 |
import javax.mail.internet.InternetAddress;
|
| 21 |
|
20 |
|
| 22 |
import org.apache.commons.lang.StringUtils;
|
21 |
import org.apache.commons.lang.StringUtils;
|
| 23 |
import org.apache.log4j.Logger;
|
22 |
import org.apache.log4j.Logger;
|
| 24 |
import org.apache.thrift.transport.TTransportException;
|
- |
|
| 25 |
|
23 |
|
| 26 |
public class Utils {
|
24 |
public class Utils {
|
| 27 |
private static Logger logger = Logger.getLogger(Utils.class);
|
25 |
private static Logger logger = Logger.getLogger(Utils.class);
|
| 28 |
|
26 |
|
| 29 |
public static final String EXPORT_ENTITIES_PATH = getExportPath();
|
27 |
public static final String EXPORT_ENTITIES_PATH = getExportPath();
|
| Line 37... |
Line 35... |
| 37 |
|
35 |
|
| 38 |
static Map<Long, String> providersMap;
|
36 |
static Map<Long, String> providersMap;
|
| 39 |
static Map<Long, String> mobileProvidersMap;
|
37 |
static Map<Long, String> mobileProvidersMap;
|
| 40 |
static Map<Long, String> dthProvidersMap;
|
38 |
static Map<Long, String> dthProvidersMap;
|
| 41 |
static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<Long, List<RechargePlan>>();
|
39 |
static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<Long, List<RechargePlan>>();
|
| - |
|
40 |
private static Map<String, Map<String, String>> uriOperatorMap = new HashMap<String, Map<String,String>>();
|
| 42 |
|
41 |
|
| 43 |
public static String[] facetDefIDs = new String[] {
|
42 |
public static String[] facetDefIDs = new String[] {
|
| 44 |
"F_50010","F_50011","F_50002","F_50001", "F_50006", "F_50007", "F_50012", "F_50013", "F_50014", "F_50015", "F_50017", "F_50018", "F_50019", "F_50020", "F_50021", "F_50022", "F_50023", "F_50024", "F_50025", "F_50026", "F_50027" };
|
43 |
"F_50010","F_50011","F_50002","F_50001", "F_50006", "F_50007", "F_50012", "F_50013", "F_50014", "F_50015", "F_50017", "F_50018", "F_50019", "F_50020", "F_50021", "F_50022", "F_50023", "F_50024", "F_50025", "F_50026", "F_50027" };
|
| 45 |
public static String[] facetLabels = new String[] {"Category","Sub Category","Price", "Brand", "Data Connectivity",
|
44 |
public static String[] facetLabels = new String[] {"Category","Sub Category","Price", "Brand", "Data Connectivity",
|
| 46 |
"Camera Resolution", "Display", "Operating System", "RAM", "Storage Capacity", "Processor",
|
45 |
"Camera Resolution", "Display", "Operating System", "RAM", "Storage Capacity", "Processor",
|
| 47 |
"Capacity", "Class", "Capacity", "Capacity", "Type", "Interface", "Resolution", "Optical Zoom", "Display Size", "Effective Resolution" };
|
46 |
"Capacity", "Class", "Capacity", "Capacity", "Type", "Interface", "Resolution", "Optical Zoom", "Display Size", "Effective Resolution" };
|
| Line 60... |
Line 59... |
| 60 |
List<RechargePlan> plans = tcl.getClient().getPlansForOperator(operatorId);
|
59 |
List<RechargePlan> plans = tcl.getClient().getPlansForOperator(operatorId);
|
| 61 |
if (!plans.isEmpty()) {
|
60 |
if (!plans.isEmpty()) {
|
| 62 |
operatorPlanMap.put(operatorId, plans);
|
61 |
operatorPlanMap.put(operatorId, plans);
|
| 63 |
}
|
62 |
}
|
| 64 |
}
|
63 |
}
|
| - |
|
64 |
for (Long operatorId : mobileProvidersMap.keySet()) {
|
| - |
|
65 |
Map<String,String> valueMap = new HashMap<String,String>();
|
| - |
|
66 |
valueMap.put("Id", operatorId+"");
|
| - |
|
67 |
valueMap.put("Name", mobileProvidersMap.get(operatorId)+"");
|
| - |
|
68 |
valueMap.put("ServiceType", "1");
|
| - |
|
69 |
valueMap.put("ServiceName", "Prepaid Mobile");
|
| - |
|
70 |
uriOperatorMap.put(mobileProvidersMap.get(operatorId).toLowerCase().trim().replace(" ", "-")+"-online-recharge", valueMap);
|
| - |
|
71 |
}
|
| - |
|
72 |
for (Long operatorId : dthProvidersMap.keySet()) {
|
| - |
|
73 |
Map<String,String> valueMap = new HashMap<String,String>();
|
| - |
|
74 |
valueMap.put("Id", operatorId+"");
|
| - |
|
75 |
valueMap.put("Name", dthProvidersMap.get(operatorId)+"");
|
| - |
|
76 |
valueMap.put("ServiceType", "2");
|
| - |
|
77 |
valueMap.put("ServiceName", "DTH TV");
|
| - |
|
78 |
uriOperatorMap.put(dthProvidersMap.get(operatorId).toLowerCase().trim().replace(" ", "-")+"-online-recharge", valueMap);
|
| - |
|
79 |
}
|
| - |
|
80 |
Map<String,String> valueMap = new HashMap<String,String>();
|
| - |
|
81 |
valueMap.put("Id", "0");
|
| - |
|
82 |
valueMap.put("Name", "Mobile and DTH");
|
| - |
|
83 |
valueMap.put("ServiceType", "1");
|
| - |
|
84 |
valueMap.put("ServiceName", "");
|
| - |
|
85 |
uriOperatorMap.put("recharge", valueMap);
|
| 65 |
// providersMap.putAll(tcl.getClient().getServiceProviders(RechargeType.DTH));
|
86 |
// providersMap.putAll(tcl.getClient().getServiceProviders(RechargeType.DTH));
|
| 66 |
} catch (Exception e) {
|
87 |
} catch (Exception e) {
|
| 67 |
logger.error("Could not get providers", e);
|
88 |
logger.error("Could not get providers", e);
|
| 68 |
}
|
89 |
}
|
| 69 |
}
|
90 |
}
|
| Line 164... |
Line 185... |
| 164 |
}
|
185 |
}
|
| 165 |
|
186 |
|
| 166 |
public static Map<Long, List<RechargePlan>> getOperatorPlanMap() {
|
187 |
public static Map<Long, List<RechargePlan>> getOperatorPlanMap() {
|
| 167 |
return operatorPlanMap;
|
188 |
return operatorPlanMap;
|
| 168 |
}
|
189 |
}
|
| - |
|
190 |
|
| - |
|
191 |
public static Map<String, String> getOperatorByUri(String uri){
|
| - |
|
192 |
return uriOperatorMap.get(uri);
|
| - |
|
193 |
}
|
| 169 |
}
|
194 |
}
|
| 170 |
|
195 |
|