package app.main.services;

import java.util.HashMap;

import org.apache.http.*;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

public class UpdateService {

	private static HashMap<String, Double> marketTable;

	public UpdateService() {
		marketTable = new HashMap<String, Double>();
		initMarketTable();
	}

	public void updateTable() {

	}

	public void updateStock(String ticker, double value) {
		marketTable.replace(ticker, value);
	}

	private void initMarketTable() {

	}

	public void getData(String symbol){
		DefaultHttpClient httpclient = new DefaultHttpClient();
		try {
			HttpHost target = new HttpHost("www.alphavantage.co", 80, "https");
			HttpGet getRequest = new HttpGet("/query?function=TIME_SERIES_INTRADAY&symbol="+ symbol + "&interval=15min&apikey=T43MK3VWRNJ7TNH8");

			HttpResponse httpResponse = httpclient.execute(target, getRequest);
			HttpEntity entity = httpResponse.getEntity();

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			httpclient.getConnectionManager().shutdown();
		}
	}
}
@@ -52,177 +52,8 @@
 p;%0A%0A
-import org.apache.http.*;%0Aimport org.apache.http.client.methods.HttpGet;%0Aimport org.apache.http.impl.client.DefaultHttpClient;%0Aimport org.apache.http.util.EntityUtils;%0A%0A
 publ
@@ -404,559 +404,6 @@
 %0A%09%7D%0A
-%0A%09public void getData(String symbol)%7B%0A%09%09DefaultHttpClient httpclient = new DefaultHttpClient();%0A%09%09try %7B%0A%09%09%09HttpHost target = new HttpHost(%22www.alphavantage.co%22, 80, %22https%22);%0A%09%09%09HttpGet getRequest = new HttpGet(%22/query?function=TIME_SERIES_INTRADAY&symbol=%22+ symbol + %22&interval=15min&apikey=T43MK3VWRNJ7TNH8%22);%0A%0A%09%09%09HttpResponse httpResponse = httpclient.execute(target, getRequest);%0A%09%09%09HttpEntity entity = httpResponse.getEntity();%0A%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D finally %7B%0A%09%09%09httpclient.getConnectionManager().shutdown();%0A%09%09%7D%0A%09%7D%0A
 %7D
+%0A

Update UpdateService.java