protected void updateEntityFields(ActionContext actionContext, IGTEntity entity)
      throws GTClientException {
    ConnectionSetupResultAForm form = (ConnectionSetupResultAForm) actionContext.getActionForm();
    IGTConnectionSetupResultEntity result = (IGTConnectionSetupResultEntity) entity;
    IGTConnectionSetupParamEntity param =
        (IGTConnectionSetupParamEntity)
            result.getFieldValue(IGTConnectionSetupResultEntity.SETUP_PARAMETERS);

    Short status = form.getStatusShort();
    if (IGTConnectionSetupResultEntity.STATUS_FAILURE.equals(status)
        || IGTConnectionSetupResultEntity.STATUS_NOT_DONE.equals(status)) {
      param.setFieldValue(
          IGTConnectionSetupParamEntity.ORIGINAL_LOCATION, form.getOriginalLocation());
      param.setFieldValue(
          IGTConnectionSetupParamEntity.SERVICING_ROUTER, form.getServicingRouter());
      param.setFieldValue(
          IGTConnectionSetupParamEntity.SECURITY_PASSWORD, form.getSecurityPassword());
    } else if (IGTConnectionSetupResultEntity.STATUS_SUCCESS.equals(status)) {
      OperationContext opCon = OperationContext.getOperationContext(actionContext.getRequest());
      List gridMasterList = (List) opCon.getAttribute(GRIDMASTER_LIST);
      List routerList = (List) opCon.getAttribute(ROUTER_LIST);
      Collection gridMasterUids = StaticCtrlUtils.getUids(gridMasterList);
      Collection routerUids = StaticCtrlUtils.getUids(routerList);
      result.setFieldValue(IGTConnectionSetupResultEntity.AVAILABLE_GRIDMASTERS, gridMasterUids);
      result.setFieldValue(IGTConnectionSetupResultEntity.AVAILABLE_ROUTERS, routerUids);
    } else {
      throw new java.lang.IllegalStateException(
          "Illegal STATUS for connectionSetupResult:" + status);
    }
  }
  protected void initialiseActionForm(ActionContext actionContext, IGTEntity entity)
      throws GTClientException {
    ConnectionSetupResultAForm form = (ConnectionSetupResultAForm) actionContext.getActionForm();
    IGTConnectionSetupResultEntity result = (IGTConnectionSetupResultEntity) entity;
    IGTConnectionSetupParamEntity param =
        (IGTConnectionSetupParamEntity)
            result.getFieldValue(IGTConnectionSetupResultEntity.SETUP_PARAMETERS);

    form.setCurrentLocation(param.getFieldString(IGTConnectionSetupParamEntity.CURRENT_LOCATION));
    form.setServicingRouter(param.getFieldString(IGTConnectionSetupParamEntity.SERVICING_ROUTER));
    form.setOriginalLocation(param.getFieldString(IGTConnectionSetupParamEntity.ORIGINAL_LOCATION));
    form.setOriginalServicingRouter(
        param.getFieldString(IGTConnectionSetupParamEntity.ORIGINAL_SERVICING_ROUTER));

    form.setStatus(result.getFieldString(IGTConnectionSetupResultEntity.STATUS));
    form.setFailureReason(result.getFieldString(IGTConnectionSetupResultEntity.FAILURE_REASON));

    prepLists(actionContext, false);
  }