* @param command the executed command or one of the virtual commands
* (see {@link HttpGenericBindingProvider})
* @param value the value to be used by the String.format method
*/
private void formatAndExecute(String itemName, Command command, Type value) {
HttpBindingProvider provider =
findFirstMatchingBindingProvider(itemName, command);
if (provider == null) {
logger.trace("doesn't find matching binding provider [itemName={}, command={}]", itemName, command);
return;
}
String httpMethod = provider.getHttpMethod(itemName, command);
String url = provider.getUrl(itemName, command);
url = String.format(url, Calendar.getInstance().getTime(), value);
if (isNotBlank(httpMethod) && isNotBlank(url)) {
HttpUtil.executeUrl(httpMethod, url, provider.getHttpHeaders(itemName, command), null, null, timeout);
}
}