Guest User

Untitled

a guest
May 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. private ListenableFuture<ResponseEntity<classDtoR>> entity;
  2.  
  3. @GetMapping("/begin")
  4. public void getValor() {
  5. AsyncRestTemplate restTemplate = new AsyncRestTemplate ();
  6. entity = restTemplate.getForEntity("http://localhost:8080/example/begin"
  7. ,classDtoR.class);
  8. }
  9.  
  10. @GetMapping("/state")
  11. public boolean getValor1() {
  12. try {
  13. return entity.isDone();
  14. } catch (Exception e) {
  15. throw new RuntimeException(e);
  16. }
  17. }
  18.  
  19. @GetMapping("/result")
  20. public ResponseEntity<ConciliacionBancoDtoR> getValor2() {
  21. try {
  22. return entity.get();
  23.  
  24. } catch (Exception e) {
  25. throw new RuntimeException(e);
  26. }
  27. }
Add Comment
Please, Sign In to add comment