class TenantAdapterRest {

    @DELETE
    @Path("{tenantId}")
    @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    @ApiOperation(value = "DeleteTenant", response = Response.class, notes = "Delete an existing tenant")
    @ApiResponses({@ApiResponse(code = 200, message = "tenant has been successfully deleted"),
            @ApiResponse(code = 500, message = "delete tenant failed")})
    public Response deleteTenant(
            @ApiParam(value = "tenantId of tenant being deleted",
                    required = true) @PathParam("tenantId") String tenantId,
            @ApiParam(value = "DeleteTenantRequest object containing additional information of tenant being deleted",
                    required = false) DeleteTenantRequest req) {
        boolean tenantDeleted = false;

        try {
            Holder<Boolean> deleted = new Holder<>();
            MsoTenantAdapter impl = tenantImpl;
            impl.deleteTenant(req.getCloudSiteId(), req.getTenantId(), req.getMsoRequest(), deleted);
            tenantDeleted = deleted.value;
        } catch (TenantException te) {
            logger.debug(EXCEPTION, te);
            DeleteTenantError exc = new DeleteTenantError(te.getFaultInfo().getMessage(),
                    te.getFaultInfo().getCategory(), Boolean.TRUE);
            return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
        } catch (Exception e) {
            logger.debug(EXCEPTION, e);
            DeleteTenantError exc = new DeleteTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE);
            return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
        }
        DeleteTenantResponse resp = new DeleteTenantResponse();
        resp.setTenantDeleted(tenantDeleted);
        return Response.status(HttpServletResponse.SC_OK).entity(resp).build();
    }

}