/*
   * (non-Javadoc)
   * @see
   * com.qat.samples.sysmgmt.bac.IServicoBAC#fetchServicoById(com.qat.samples.sysmgmt.model.request.FetchByIdRequest
   * )
   */
  @Override
  public InternalResultsResponse<Servico> fetchServicoById(FetchByIdRequest request) {
    InternalResultsResponse<Servico> response = new InternalResultsResponse<Servico>();
    // validate fetchId field
    if (ValidationUtil.isNull(request.getFetchId())) {
      response.addFieldErrorMessage(SYSMGMT_BASE_ID_REQUIRED);
      response.setStatus(SystemErrorCategory.SystemValidation);
    } else {
      response.getResultsList().add(getSiteBAR().fetchServicoById(request));
    }

    return response;
  }
  /*
   * (non-Javadoc)
   * @see com.qat.samples.sysmgmt.dapi.impl.IProcedureWS#fetchProcedureById(com.qat.samples.sysmgmt.model.request.
   * FetchByIdRequest)
   */
  @Override
  public ProcedureResponse fetchProcedureById(FetchByIdRequest request) {
    ProcedureResponse response = new ProcedureResponse();

    try {
      InternalResultsResponse<Procedure> internalResponse =
          new InternalResultsResponse<Procedure>();

      internalResponse = getProcedureBAC().fetchProcedureById(request);
      // Handle the processing for all previous methods regardless of them failing or succeeding.
      ResponseHandler.handleOperationStatusAndMessages(response, internalResponse, true);
    } catch (Exception ex) {
      ResponseHandler.handleException(
          LOG,
          response,
          ex,
          DEFAULT_EXCEPTION_MSG,
          new Object[] {CLASS_NAME},
          request.getRequestContext());
    }

    return response;
  }