use of com.emc.cloud.platform.clientlib.ClientHttpRequest in project coprhd-controller by CoprHD.
the class UCSMHttpTransportWrapper method postEntity.
public <T> T postEntity(String serviceURI, JAXBElement<T> jaxbElement, Class<T> returnType) throws ClientGeneralException {
URL ucsmURL = null;
ClientHttpRequest httpRequest = null;
try {
ucsmURL = new URL(serviceURI);
} catch (MalformedURLException ex) {
throw new ClientGeneralException(ClientMessageKeys.MALFORMED_URL);
}
if (ucsmURL.getProtocol().equalsIgnoreCase("https")) {
httpRequest = ucsSSLTransportRequestFactory.create();
} else {
httpRequest = ucsTransportRequestFactory.create();
}
T result = null;
try {
result = httpRequest.httpPostXMLObject(serviceURI, jaxbElement, returnType);
} catch (ClientGeneralException e) {
LOGGER.info(e.getLocalizedMessage(), e);
throw e;
}
return result;
}
Aggregations