Subversion Repositories SmartDukaan

Rev

Rev 1458 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1458 Rev 2942
Line 27... Line 27...
27
	
27
	
28
	static{
28
	static{
29
		try {
29
		try {
30
			AFL_URL = ConfigClient.getClient().get("afl_update_url");
30
			AFL_URL = ConfigClient.getClient().get("afl_update_url");
31
		} catch (ConfigException e) {
31
		} catch (ConfigException e) {
32
			e.printStackTrace();
32
		    log.error("Unable to get the tracking url from the config service", e);
33
		}
33
		}
34
	}
34
	}
35
	
35
	
36
	public List<ShipmentUpdate> getUpdates(String awbNumber){
36
	public List<ShipmentUpdate> getUpdates(String awbNumber){
37
		//String uri = "http://trackntrace.aflwiz.com/aflwiztrack?shpntnum=" + awbNumber;
37
		//String uri = "http://trackntrace.aflwiz.com/aflwiztrack?shpntnum=" + awbNumber;
Line 60... Line 60...
60
		    Date date = null;
60
		    Date date = null;
61
			try {
61
			try {
62
				date = sdfSource.parse(update.date);
62
				date = sdfSource.parse(update.date);
63
				update.date = sdfDestination.format(date);
63
				update.date = sdfDestination.format(date);
64
			} catch (ParseException e) {
64
			} catch (ParseException e) {
65
				e.printStackTrace();
65
			    log.error("Unable to parse the tracking date", e);
66
			}
66
			}
67
			update.time = getElementTextContent(hawbUpdate, "CHECKTIME");
67
			update.time = getElementTextContent(hawbUpdate, "CHECKTIME");
68
			update.city = getElementTextContent(hawbUpdate, "LOCATIONNAME");
68
			update.city = getElementTextContent(hawbUpdate, "LOCATIONNAME");
69
			update.description = getElementTextContent(hawbUpdate, "CHECKPOINTDESCRIPTION");			
69
			update.description = getElementTextContent(hawbUpdate, "CHECKPOINTDESCRIPTION");			
70
			updates.add(update);
70
			updates.add(update);