Subversion Repositories SmartDukaan

Rev

Rev 13899 | Rev 15223 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13899 Rev 13950
Line 594... Line 594...
594
			}
594
			}
595
			itemIdpendingOrdersMap.put(sku, pending_orders);
595
			itemIdpendingOrdersMap.put(sku, pending_orders);
596
 
596
 
597
		}
597
		}
598
	}
598
	}
-
 
599
	
-
 
600
	public static void handleLogout(){
-
 
601
		HttpGet get = new HttpGet("http://selleraccounts.snapdeal.com/logout?service=http://seller.snapdeal.com/");
-
 
602
		HttpResponse response = null;
-
 
603
		try {
-
 
604
			response = client.execute(get);
-
 
605
		} catch (ClientProtocolException e) {
-
 
606
 
-
 
607
			e.printStackTrace();
-
 
608
		} catch (IOException e) {
-
 
609
 
-
 
610
			e.printStackTrace();
-
 
611
		}
-
 
612
		BufferedReader rd = null;
-
 
613
		try {
-
 
614
			rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-
 
615
		} catch (IllegalStateException e1) {
-
 
616
 
-
 
617
			e1.printStackTrace();
-
 
618
		} catch (IOException e1) {
-
 
619
 
-
 
620
			e1.printStackTrace();
-
 
621
		}
-
 
622
		String line = "";
-
 
623
		try{
-
 
624
			while ((line = rd.readLine()) != null) {
-
 
625
				//System.out.println(line);
-
 
626
			}
-
 
627
		}catch (IOException e1) {
-
 
628
 
-
 
629
			e1.printStackTrace();
-
 
630
		}
-
 
631
	}
599
 
632
 
600
	public static void handleLogin() throws ClientProtocolException, IOException{
633
	public static void handleLogin() throws ClientProtocolException, IOException{
601
		HttpGet get = new HttpGet("http://selleraccounts.snapdeal.com/login?service=http%3A%2F%2Fseller.snapdeal.com%2Fj_spring_cas_security_check");
634
		HttpGet get = new HttpGet("http://selleraccounts.snapdeal.com/login?service=http%3A%2F%2Fseller.snapdeal.com%2Fj_spring_cas_security_check");
602
		HttpResponse response = null;
635
		HttpResponse response = null;
603
		try {
636
		try {
Line 1129... Line 1162...
1129
				System.out.println("++++++++++++++++++++++++++++++");
1162
				System.out.println("++++++++++++++++++++++++++++++");
1130
				Thread.sleep(30*60*1000);
1163
				Thread.sleep(30*60*1000);
1131
			} catch (InterruptedException e) {
1164
			} catch (InterruptedException e) {
1132
				e.printStackTrace();
1165
				e.printStackTrace();
1133
			}
1166
			}
1134
 
-
 
-
 
1167
			handleLogout();
1135
		}
1168
		}
1136
		else{
1169
		else{
1137
			try {
1170
			try {
1138
				mailer.sendSSLMessage(sendTo,"No changes in Snapdeal inventory to update "+ sdf.format(System.currentTimeMillis()),"No change in Snapdeal Inventory to be updated ", emailFromAddress, password, new ArrayList<File>());
1171
				mailer.sendSSLMessage(sendTo,"No changes in Snapdeal inventory to update "+ sdf.format(System.currentTimeMillis()),"No change in Snapdeal Inventory to be updated ", emailFromAddress, password, new ArrayList<File>());
1139
			} catch (Exception e) {
1172
			} catch (Exception e) {
Line 1145... Line 1178...
1145
				System.out.println("++++++++++++++++++++++++++++++");
1178
				System.out.println("++++++++++++++++++++++++++++++");
1146
				Thread.sleep(30*60*1000);
1179
				Thread.sleep(30*60*1000);
1147
			} catch (InterruptedException e) {
1180
			} catch (InterruptedException e) {
1148
				e.printStackTrace();
1181
				e.printStackTrace();
1149
			}
1182
			}
-
 
1183
			handleLogout();
1150
		}
1184
		}
1151
		String tableHeader = "<tr>" 
1185
		String tableHeader = "<tr>" 
1152
			+ "<td>" + "Product Name" +"</td>"
1186
			+ "<td>" + "Product Name" +"</td>"
1153
			+"<td>" + "SKU at Snapdeal" + "</td>"
1187
			+"<td>" + "SKU at Snapdeal" + "</td>"
1154
			+"<td>" + "SUPC" + "</td>"
1188
			+"<td>" + "SUPC" + "</td>"