Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Vector<ArrayList<String>> getDataFromService(RoamingParamExport parameters) {
- Map<String, Object> params = parameters.getAllParameters();
- Properties deployProperties = loadDeploymentProperties();
- String user = deployProperties.getProperty("deployment.module.account.user");
- String password = deployProperties.getProperty("deployment.module.account.password");
- BasicAuthentication authentication = new BasicAuthentication(user, password);
- String endpoint = parameters.getCustomerContext() ? "export-customer-data" : "export-data";
- RoamingConfiguration roamingConfiguration = RoamingConfiguration.getInstance();
- // Map<String, Object> service = new ResteasyClientBuilder().build()
- // .target(serviceDiscoveryUrl)
- // .register(authentication)
- // .path(chartType.getOutput())
- // .request()
- // .get(new GenericType<LinkedHashMap<String, Object>>(){});
- String host = "http://" + "wodor.krakow.comarch:11258";//service.get("host") + ":" + service.get("port");
- ResteasyWebTarget client = new ResteasyClientBuilder().build()
- .target(host)
- .register(authentication)
- .path("/rest/big-data/" + endpoint);
- // .path(service.get("url").toString());
- for (Map.Entry<String, Object> entry : params.entrySet())
- if (entry.getValue() != null) client = client.queryParam(entry.getKey(), entry.getValue());
- Vector<ArrayList<String>> chart = client.request()
- .get(Vector.class);
- return chart;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement