class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvider {

    @Override
    public Optional<DeleteVnfResponse> invokeDeleteRequest(final String vnfId) {
        try {
            final String url = urlProvider.getDeleteUrl(vnfId);
            LOGGER.debug("Will send request to vnfm adapter using url: {}", url);

            final ResponseEntity<DeleteVnfResponse> response =
                    httpServiceProvider.deleteHttpRequest(url, DeleteVnfResponse.class);

            LOGGER.debug("Response received: ", response);

            final HttpStatus httpStatus = response.getStatusCode();

            if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) {
                LOGGER.error("Unable to invoke HTTP DELETE using URL: {}, Response Code: {}", url, httpStatus.value());
                return Optional.absent();
            }

            if (!response.hasBody()) {
                LOGGER.error(RECEIVED_RESPONSE_WITHOUT_BODY, response);
                return Optional.absent();
            }
            final DeleteVnfResponse deleteVnfResponse = response.getBody();

            if (deleteVnfResponse.getJobId() == null || deleteVnfResponse.getJobId().isEmpty()) {
                LOGGER.error("Received invalid delete response: {}", response);
                return Optional.absent();
            }
            return Optional.of(deleteVnfResponse);
        } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
            LOGGER.error("Unexpected error while processing delete request", httpInvocationException);
            return Optional.absent();
        }
    }

    @Autowired public  VnfmAdapterServiceProviderImpl(final VnfmAdapterUrlProvider urlProvider,
            final HttpRestServiceProvider httpServiceProvider);

}