class VfcManager {

    public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId) throws ApplicationException {

        ValidateUtil.assertObjectNotNull(jobId);
        // Step 1: query the current resource operation status
        ResourceOperationStatus status = new ResourceOperationStatus(nsOperationKey.getServiceId(),
                nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID());
        status = resourceOperationStatusRepository.findOne(Example.of(status))
                .orElseThrow(() -> new ApplicationException(404, "Cannot Find Operation Status"));
        // Step 2: start query
        LOGGER.info("query ns status -> begin");
        String url = getUrl(jobId, CommonConstant.Step.QUERY);
        String methodType = CommonConstant.MethodType.GET;
        // prepare restful parameters and options
        RestfulResponse rsp = restfulUtil.send(url, methodType, "");
        ValidateUtil.assertObjectNotNull(rsp);
        LOGGER.info("query ns progress response status is : {}", rsp.getStatus());
        LOGGER.info("query ns progress response content is : {}", rsp.getResponseContent());
        // Step 3:check the response staus
        if (!HttpCode.isSucess(rsp.getStatus())) {
            LOGGER.info("fail to query job status");
            status.setErrorCode(String.valueOf(rsp.getStatus()));
            status.setStatus(RequestsDbConstant.Status.ERROR);
            status.setStatusDescription(CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED);
            resourceOperationStatusRepository.save(status);
            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_QUERY_JOB_STATUS);
        }
        // Step 4: Process Network Service Instantiate Response
        NsProgressStatus nsProgress = JsonUtil.unMarshal(rsp.getResponseContent(), NsProgressStatus.class);
        ResponseDescriptor rspDesc = nsProgress.getResponseDescriptor();
        // Step 5: update segment operation progress

        status.setProgress(rspDesc.getProgress());
        status.setStatusDescription(rspDesc.getStatusDescription());
        resourceOperationStatusRepository.save(status);

        // Step 6: update segment operation status
        if (RequestsDbConstant.Progress.ONE_HUNDRED.equals(rspDesc.getProgress())
                && RequestsDbConstant.Status.FINISHED.equals(rspDesc.getStatus())) {
            LOGGER.info("job result is succeeded, operType is {}", status.getOperType());
            status.setErrorCode(String.valueOf(rsp.getStatus()));
            status.setStatusDescription(CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED);

            if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(status.getOperType())
                    || "createInstance".equalsIgnoreCase(status.getOperType())) {
                status.setStatus(RequestsDbConstant.Status.FINISHED);
            }
            resourceOperationStatusRepository.save(status);
        } else if (RequestsDbConstant.Status.ERROR.equals(rspDesc.getStatus())) {
            LOGGER.error("job result is failed, operType is {}", status.getOperType());
            status.setErrorCode(String.valueOf(rsp.getStatus()));
            status.setStatusDescription(CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED);
            status.setStatus(RequestsDbConstant.Status.ERROR);
            resourceOperationStatusRepository.save(status);
            throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.JOB_STATUS_ERROR);
        } else {
            LOGGER.error("unexcepted response status");
        }
        LOGGER.info("query ns status -> end");

        return rsp;
    }

    public  VfcManager();

}