9package org.udger.parser;
13 public static final String SQL_CRAWLER =
15 "NULL AS client_id, " +
16 "NULL AS class_id, " +
17 "'Crawler' AS ua_class, " +
18 "'crawler' AS ua_class_code, " +
20 "NULL AS ua_engine, " +
21 "ver AS ua_version, " +
22 "ver_major AS ua_version_major, " +
23 "last_seen AS crawler_last_seen, " +
24 "respect_robotstxt AS crawler_respect_robotstxt, " +
25 "crawler_classification AS crawler_category, " +
26 "crawler_classification_code AS crawler_category_code, " +
27 "NULL AS ua_uptodate_current_version, " +
28 "family AS ua_family, " +
29 "family_code AS ua_family_code, " +
30 "family_homepage AS ua_family_homepage, " +
31 "family_icon AS ua_family_icon, " +
32 "NULL AS ua_family_icon_big, " +
33 "vendor AS ua_family_vendor, " +
34 "vendor_code AS ua_family_vendor_code, " +
35 "vendor_homepage AS ua_family_vendor_homepage, " +
36 "'https://udger.com/resources/ua-list/bot-detail?bot=' || REPLACE(family, ' ', '%20') || '#id' || udger_crawler_list.id AS ua_family_info_url " +
38 "udger_crawler_list " +
40 "udger_crawler_class ON udger_crawler_class.id = udger_crawler_list.class_id " +
44 public static final String SQL_CLIENT =
47 "client_id AS client_id, " +
48 "class_id AS class_id, " +
49 "client_classification AS ua_class, " +
50 "client_classification_code AS ua_class_code, " +
52 "engine AS ua_engine, " +
53 "NULL AS ua_version, " +
54 "NULL AS ua_version_major, " +
55 "NULL AS crawler_last_seen, " +
56 "NULL AS crawler_respect_robotstxt, " +
57 "NULL AS crawler_category, " +
58 "NULL AS crawler_category_code, " +
59 "uptodate_current_version AS ua_uptodate_current_version, " +
60 "name AS ua_family, " +
61 "name_code AS ua_family_code, " +
62 "homepage AS ua_family_homepage, " +
63 "icon AS ua_family_icon, " +
64 "icon_big AS ua_family_icon_big, " +
65 "vendor AS ua_family_vendor, " +
66 "vendor_code AS ua_family_vendor_code, " +
67 "vendor_homepage AS ua_family_vendor_homepage, " +
68 "'https://udger.com/resources/ua-list/browser-detail?browser=' || REPLACE(name, ' ', '%20') AS ua_family_info_url " +
70 "udger_client_regex ur " +
72 "udger_client_list ON udger_client_list.id = ur.client_id " +
74 "udger_client_class ON udger_client_class.id = udger_client_list.class_id " +
78 private static final String OS_COLUMNS =
79 "family AS os_family, " +
80 "family_code AS os_family_code, " +
82 "name_code AS os_code, " +
83 "homepage AS os_home_page, " +
85 "icon_big AS os_icon_big, " +
86 "vendor AS os_family_vendor, " +
87 "vendor_code AS os_family_vendor_code, " +
88 "vendor_homepage AS os_family_vendor_homepage, " +
89 "'https://udger.com/resources/ua-list/os-detail?os=' || REPLACE(name, ' ', '%20') AS os_info_url ";
91 public static final String SQL_OS =
96 "udger_os_regex ur " +
98 "udger_os_list ON udger_os_list.id = ur.os_id " +
102 public static final String SQL_CLIENT_OS =
106 "udger_client_os_relation " +
108 "udger_os_list ON udger_os_list.id = udger_client_os_relation.os_id " +
112 private static final String DEVICE_COLUMNS =
113 "name AS device_class, " +
114 "name_code AS device_class_code, " +
115 "icon AS device_class_icon, " +
116 "icon_big AS device_class_icon_big, " +
117 "'https://udger.com/resources/ua-list/device-detail?device=' || REPLACE(name, ' ', '%20') AS device_class_info_url ";
119 public static final String SQL_DEVICE =
124 "udger_deviceclass_regex ur " +
126 "udger_deviceclass_list ON udger_deviceclass_list.id = ur.deviceclass_id " +
131 public static final String SQL_CLIENT_CLASS =
135 "udger_deviceclass_list " +
137 "udger_client_class ON udger_client_class.deviceclass_id = udger_deviceclass_list.id " +
139 "udger_client_class.id = ?";
141 private static final String IP_COLUMNS =
142 "ip_classification AS ip_classification, " +
143 "ip_classification_code AS ip_classification_code, " +
144 "ip_last_seen AS ip_last_seen, " +
145 "ip_hostname AS ip_hostname, " +
146 "ip_country AS ip_country, " +
147 "ip_country_code AS ip_country_code, " +
148 "ip_city AS ip_city, " +
149 "name AS crawler_name, " +
150 "ver AS crawler_ver, " +
151 "ver_major AS crawler_ver_major, " +
152 "family AS crawler_family, " +
153 "family_code AS crawler_family_code, " +
154 "family_homepage AS crawler_family_homepage, " +
155 "vendor AS crawler_family_vendor, " +
156 "vendor_code AS crawler_family_vendor_code, " +
157 "vendor_homepage AS crawler_family_vendor_homepage, " +
158 "family_icon AS crawler_family_icon, " +
159 "'https://udger.com/resources/ua-list/bot-detail?bot=' || REPLACE(family, ' ', '%20') || '#id' || udger_crawler_list.id AS crawler_family_info_url, " +
160 "last_seen AS crawler_last_seen, " +
161 "crawler_classification AS crawler_category, " +
162 "crawler_classification_code AS crawler_category_code, " +
163 "respect_robotstxt AS crawler_respect_robotstxt ";
165 public static final String SQL_IP =
171 "udger_ip_class ON udger_ip_class.id=udger_ip_list.class_id " +
173 "udger_crawler_list ON udger_crawler_list.id=udger_ip_list.crawler_id " +
175 "udger_crawler_class ON udger_crawler_class.id=udger_crawler_list.class_id " +
181 private static final String DATACENTER_COLUMNS =
182 "name AS datacenter_name, " +
183 "name_code AS datacenter_name_code, " +
184 "homepage AS datacenter_homepage ";
186 public static final String SQL_DATACENTER =
190 "udger_datacenter_range " +
192 "udger_datacenter_list ON udger_datacenter_range.datacenter_id = udger_datacenter_list.id " +
194 "iplong_from <= ? AND iplong_to >= ?";
196 public static final String SQL_DATACENTER_RANGE6 =
200 "udger_datacenter_range6 " +
202 "udger_datacenter_list ON udger_datacenter_range6.datacenter_id=udger_datacenter_list.id " +
204 "iplong_from0 <= ? AND iplong_to0 >= ? AND " +
205 "iplong_from1 <= ? AND iplong_to1 >= ? AND " +
206 "iplong_from2 <= ? AND iplong_to2 >= ? AND " +
207 "iplong_from3 <= ? AND iplong_to3 >= ? AND " +
208 "iplong_from4 <= ? AND iplong_to4 >= ? AND " +
209 "iplong_from5 <= ? AND iplong_to5 >= ? AND " +
210 "iplong_from6 <= ? AND iplong_to6 >= ? AND " +
211 "iplong_from7 <= ? AND iplong_to7 >=?";
213 public static final String SQL_DEVICE_REGEX =
218 "udger_devicename_regex " +
220 "os_family_code=? AND (os_code='-all-' OR os_code=?) " +
223 public static final String SQL_DEVICE_NAME_LIST =
232 "udger_devicename_list " +
234 "udger_devicename_brand ON udger_devicename_brand.id=udger_devicename_list.brand_id " +
236 "regex_id = ? AND code = ?";