/*
   * (non-Javadoc)
   * @see com.qat.samples.sysmgmt.bac.IContatoBAC#refreshContatos(com.qat.samples.sysmgmt.model.request.RefreshRequest)
   */
  @Override
  public InternalResultsResponse<Contato> refreshContatos(RefreshRequest request) {
    // This method is demo code only. Do not view this as a QAT Global Standard.
    getSiteBAR().deleteAllContatos();
    int refreshNumber = request.getRefreshInt();
    refreshNumber = (refreshNumber < 1) ? MINIMUM_ENTRIES : refreshNumber;

    // Call maintain to see if we need to return the contato list and if so whether it should be
    // paged or not
    return maintainReturnListContato(
        request.getReturnList(), request.getReturnListPaged(), new Contato());
  }
  /*
   * (non-Javadoc)
   * @see com.qat.samples.sysmgmt.bac.IServicoBAC#refreshServicos(com.qat.samples.sysmgmt.model.request.RefreshRequest)
   */
  @Override
  public InternalResultsResponse<Servico> refreshServicos(RefreshRequest request) {
    // This method is demo code only. Do not view this as a QAT Global Standard.
    getSiteBAR().deleteAllServicos();
    int refreshNumber = request.getRefreshInt();
    refreshNumber = (refreshNumber < 1) ? MINIMUM_ENTRIES : refreshNumber;

    for (int i = 1; i <= refreshNumber; i++) {
      getSiteBAR().insertServico(new Servico(i, "ServicoDesc" + i));
    }

    // Call maintain to see if we need to return the servico list and if so whether it should be
    // paged or not
    return maintainReturnListServico(
        request.getReturnList(), request.getReturnListPaged(), new Servico());
  }
  @Override
  public ProcedureResponse refreshProcedures(RefreshRequest request) {
    // This method is demo code only. Do not view this as a QAT Global Standard.
    ProcedureResponse response = new ProcedureResponse();

    try {
      InternalResultsResponse<Procedure> internalResponse =
          getProcedureBAC().refreshProcedures(request);
      ResponseHandler.populateResponse(
          response, internalResponse, DEFAULT_ERROR_MSG, request.getRequestContext());
    } catch (Exception ex) {
      ResponseHandler.handleException(
          LOG,
          response,
          ex,
          DEFAULT_EXCEPTION_MSG,
          new Object[] {CLASS_NAME},
          request.getRequestContext());
    }

    return response;
  }