Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. private Vector<ArrayList<String>> getDataFromService(RoamingParamExport parameters) {
  2. Map<String, Object> params = parameters.getAllParameters();
  3. Properties deployProperties = loadDeploymentProperties();
  4. String user = deployProperties.getProperty("deployment.module.account.user");
  5. String password = deployProperties.getProperty("deployment.module.account.password");
  6. BasicAuthentication authentication = new BasicAuthentication(user, password);
  7. String endpoint = parameters.getCustomerContext() ? "export-customer-data" : "export-data";
  8.  
  9. RoamingConfiguration roamingConfiguration = RoamingConfiguration.getInstance();
  10.  
  11. // Map<String, Object> service = new ResteasyClientBuilder().build()
  12. // .target(serviceDiscoveryUrl)
  13. // .register(authentication)
  14. // .path(chartType.getOutput())
  15. // .request()
  16. // .get(new GenericType<LinkedHashMap<String, Object>>(){});
  17.  
  18. String host = "http://" + "wodor.krakow.comarch:11258";//service.get("host") + ":" + service.get("port");
  19.  
  20.  
  21. ResteasyWebTarget client = new ResteasyClientBuilder().build()
  22. .target(host)
  23. .register(authentication)
  24. .path("/rest/big-data/" + endpoint);
  25. // .path(service.get("url").toString());
  26.  
  27. for (Map.Entry<String, Object> entry : params.entrySet())
  28. if (entry.getValue() != null) client = client.queryParam(entry.getKey(), entry.getValue());
  29.  
  30. Vector<ArrayList<String>> chart = client.request()
  31. .get(Vector.class);
  32.  
  33. return chart;
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement