public Map<String, String> callEshopToSendEshopBid(HttpServletRequest request) {
this.initDao(constExternalPlatformDAO);
Map<String, String> resultMap = new HashMap<String, String>();
resultMap.put(Constants.PARM_NAME_CME_UPGRADE_STATUS, Constants.PARM_VALUE_CME_UPGRADE_NOT_ALLOWED);
resultMap.put(Constants.PARM_NAME_CME_UPGRADE_MESSAGE, "");
ExternalPlatform externalPlatform = null; // TODO trova riga eShop
BidForEshopObject bidForEshopObject = null; // TODO chiama service per costruire oggetto
CheckUserSsoPost checkUserSsoPost = new CheckUserSsoPost();
Map<String, String> parameterMap = new HashMap<String, String>();
Map<String, String> callResultMap = new HashMap<String, String>();
String returnStatus = null;
String returnMessage = null;
String url = externalPlatform.getRestCallProtocol() + externalPlatform.getDestinationAddress() + ":" + externalPlatform.getRestCallPort() + externalPlatform.getRestCallAuthMethod();
parameterMap.clear();
parameterMap.put( "productCode", bidForEshopObject.getProductCode() );
parameterMap.put( "productId", bidForEshopObject.getProductId() );
// ... inserisco gli altri parametri dell'oggetto
try {
callResultMap = checkUserSsoPost.httpRestClientPost(url, parameterMap);
} catch (Exception e) {
e.printStackTrace();
}
returnStatus = callResultMap.get(Constants.PARM_NAME_CME_UPGRADE_STATUS);
returnMessage = callResultMap.get(Constants.PARM_NAME_CME_UPGRADE_MESSAGE);
// resultMap.put( ** status corretto se tutto ok oppure errori)
// resultMap.put( ** messaggio corretto se tutto ok oppure errori)
return resultMap;
}