List of usage examples for org.springframework.web.client AsyncRestTemplate postForEntity
@Override public <T> ListenableFuture<ResponseEntity<T>> postForEntity(String url, @Nullable HttpEntity<?> request, Class<T> responseType, Map<String, ?> uriVariables) throws RestClientException
From source file:io.getlime.security.powerauth.app.server.service.behavior.CallbackUrlBehavior.java
/** * Tries to asynchronously notify all callbacks that are registered for given application. * @param applicationId Application for the callbacks to be used. * @param activationId Activation ID to be notified about. *///www.jav a 2 s . c o m public void notifyCallbackListeners(Long applicationId, String activationId) { final Iterable<CallbackUrlEntity> callbackUrlEntities = callbackUrlRepository .findByApplicationIdOrderByName(applicationId); Map<String, String> callbackData = new HashMap<>(); callbackData.put("activationId", activationId); AsyncRestTemplate template = new AsyncRestTemplate(); for (CallbackUrlEntity callbackUrl : callbackUrlEntities) { HttpEntity<Map<String, String>> request = new HttpEntity<>(callbackData); template.postForEntity(callbackUrl.getCallbackUrl(), request, Map.class, new HashMap<>()); } }