Ejemplo n.º 1
0
  @Override
  protected void syncSearch() {
    if (getEntity() == null) {
      return;
    }

    super.syncSearch();

    IdQueryParameters tempVar = new IdQueryParameters(getEntity().getId());
    tempVar.setRefresh(getIsQueryFirstTime());
    Frontend.getInstance()
        .runQuery(
            VdcQueryType.GetVmsByStorageDomain,
            tempVar,
            new AsyncQuery<>(
                new AsyncCallback<VdcQueryReturnValue>() {
                  @Override
                  public void onSuccess(VdcQueryReturnValue returnValue) {
                    ArrayList<VM> vms = returnValue.getReturnValue();
                    Collections.sort(vms, new LexoNumericNameableComparator<>());
                    setItems(vms);
                    setIsEmpty(vms.size() == 0);
                  }
                }));
  }
  @Override
  protected void syncSearch() {
    if (getEntity() == null) {
      return;
    }

    super.syncSearch();

    IdQueryParameters parameters = new IdQueryParameters((getEntity()).getId());
    parameters.setRefresh(getIsQueryFirstTime());

    Frontend.getInstance()
        .runQuery(
            VdcQueryType.GetAllDisksByStorageDomainId,
            parameters,
            new AsyncQuery(
                this,
                new INewAsyncCallback() {
                  @Override
                  public void onSuccess(Object model, Object ReturnValue) {
                    StorageDiskListModel storageDiskListModel = (StorageDiskListModel) model;
                    storageDiskListModel.setItems(
                        (ArrayList) ((VdcQueryReturnValue) ReturnValue).getReturnValue());
                  }
                }));
  }
  @Override
  protected void syncSearch() {
    if (getEntity() == null) {
      return;
    }

    super.syncSearch();

    AsyncQuery _asyncQuery = new AsyncQuery();
    _asyncQuery.setModel(this);
    _asyncQuery.asyncCallback =
        new INewAsyncCallback() {
          @Override
          public void onSuccess(Object model, Object ReturnValue) {
            StorageVmListModel vmModel = (StorageVmListModel) model;
            vmModel.setItems((ArrayList<VM>) ((VdcQueryReturnValue) ReturnValue).getReturnValue());
            vmModel.setIsEmpty(((List) vmModel.getItems()).size() == 0);
          }
        };

    IdQueryParameters tempVar = new IdQueryParameters(getEntity().getId());
    tempVar.setRefresh(getIsQueryFirstTime());
    Frontend.getInstance().runQuery(VdcQueryType.GetVmsByStorageDomain, tempVar, _asyncQuery);
  }