package org.ovirt.engine.ui.frontend;

import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;

public class AsyncQuery {
    public Object Model;
    public INewAsyncCallback asyncCallback;
    public IAsyncConverter converterCallback;
    private boolean handleFailure;
    public VdcQueryReturnValue OriginalReturnValue;
    public Object[] Data;
    private String context;

    public AsyncQuery() {
    }

    public AsyncQuery(Object target, INewAsyncCallback asyncCallback) {
        setModel(target);
        this.asyncCallback = asyncCallback;
    }

    public AsyncQuery(Object target, INewAsyncCallback asyncCallback, boolean handleFailure) {
        setModel(target);
        this.asyncCallback = asyncCallback;
        this.handleFailure = handleFailure;
    }

    public AsyncQuery(Object target, INewAsyncCallback asyncCallback, String context) {
        setModel(target);
        this.asyncCallback = asyncCallback;
        this.context = context;
    }

    public Object[] getData() {
        return Data;
    }

    public void setData(Object[] data) {
        this.Data = data;
    }

    public VdcQueryReturnValue getOriginalReturnValue() {
        return OriginalReturnValue;
    }

    public void setOriginalReturnValue(VdcQueryReturnValue originalReturnValue) {
        this.OriginalReturnValue = originalReturnValue;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public boolean isHandleFailure() {
        return handleFailure;
    }

    public void setHandleFailure(boolean handleFailure) {
        this.handleFailure = handleFailure;
    }

    public Object getModel() {
        return Model;
    }

    public void setModel(Object model) {
        this.Model = model;
    }

    public INewAsyncCallback getDel() {
        return asyncCallback;
    }

    public void setDel(INewAsyncCallback asyncCallback) {
        this.asyncCallback = asyncCallback;
    }

    public IAsyncConverter getConverter() {
        return converterCallback;
    }
}

@@ -124,16 +124,320 @@
 Query %7B%0A
+%0A    /**%0A     * Null object singleton that represents an empty (no-op) query callback.%0A     */%0A    private static final INewAsyncCallback EMPTY_CALLBACK = new INewAsyncCallback() %7B%0A        @Override%0A        public void OnSuccess(Object model, Object returnValue) %7B%0A            // Empty%0A        %7D%0A    %7D;%0A%0A
     publ
@@ -707,24 +707,69 @@
 ncQuery() %7B%0A
+        this.asyncCallback = EMPTY_CALLBACK;%0A
     %7D%0A%0A    p
@@ -2444,10 +2444,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

Fix AsyncQuery related NPE