class SDNCConnector {

    public SDNCResponseCommon send(String content, TypedRequestTunables rt) {
        logger.debug("SDNC URL: {}", rt.getSdncUrl());
        logger.debug("SDNC Request Body:\n {}", content);

        HttpRequestBase method = null;
        HttpResponse httpResponse = null;

        try {

            HttpClient client = HttpClientBuilder.create().build();

            method = getHttpRequestMethod(content, rt);


            String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.SDNC_AUTH_PROP),
                    env.getProperty(Constants.ENCRYPTION_KEY_PROP));
            String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
            if (null != method) {
                method.setHeader("Authorization", authorization);
                method.setHeader("Accept", "application/yang.data+xml");
            } else {
                logger.debug("method is NULL:");
            }

            httpResponse = client.execute(method);

            String responseContent = null;
            if (httpResponse.getEntity() != null) {
                responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
            }

            int statusCode = httpResponse.getStatusLine().getStatusCode();
            String statusMessage = httpResponse.getStatusLine().getReasonPhrase();

            logger.debug("SDNC Response: {} {}", statusCode,
                    statusMessage + (responseContent == null ? "" : System.lineSeparator() + responseContent));

            if (httpResponse.getStatusLine().getStatusCode() >= 300) {
                String errMsg = "SDNC returned " + statusCode + " " + statusMessage;

                String errors = analyzeErrors(responseContent);
                if (errors != null && !errors.isEmpty()) {
                    errMsg += " " + errors;
                }

                logError(errMsg);

                return createErrorResponse(statusCode, errMsg, rt);
            }

            httpResponse = null;

            if (null != method) {
                method.reset();
            } else {
                logger.debug("method is NULL:");
            }

            method = null;

            logger.info(LoggingAnchor.THREE, MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), responseContent, "SDNC");
            return createResponseFromContent(statusCode, statusMessage, responseContent, rt);

        } catch (SocketTimeoutException | ConnectTimeoutException e) {
            String errMsg = "Request to SDNC timed out";
            logError(errMsg, e);
            return createErrorResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg, rt);

        } catch (Exception e) {
            String errMsg = "Error processing request to SDNC";
            logError(errMsg, e);
            return createErrorResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, errMsg, rt);

        } finally {
            if (httpResponse != null) {
                try {
                    EntityUtils.consume(httpResponse.getEntity());
                } catch (Exception e) {
                    logger.debug("Exception:", e);
                }
            }

            if (method != null) {
                try {
                    method.reset();
                } catch (Exception e) {
                    logger.debug("Exception:", e);
                }
            }
        }
    }

}