/** * Returns {@code true} if execution of given operation caused the Engine session to be refreshed. */ boolean engineSessionRefreshed(VdcOperation<?, ?> operation) { // Actions always refresh the Engine session if (operation.isAction()) { return true; } else if (((QueryParametersBase) operation.getParameter()).getRefresh()) { // Queries optionally refresh the Engine session return true; } return false; }
@Override public void serviceFound(GenericApiGWTServiceAsync service) { service.runPublicQuery((QueryType) operation.getOperation(), (QueryParametersBase) operation.getParameter(), new AsyncCallback<QueryReturnValue>() { @Override public void onFailure(final Throwable exception) { operation.getCallback().onFailure(operation, exception); } @Override public void onSuccess(final QueryReturnValue result) { operation.getCallback().onSuccess(operation, result); } }); }
@Override public void serviceFound(GenericApiGWTServiceAsync service) { service.runQuery((QueryType) operation.getOperation(), (QueryParametersBase) operation.getParameter(), new AsyncCallback<QueryReturnValue>() { @Override public void onFailure(final Throwable exception) { //Clear out the token, and let the retry mechanism try again. xsrfRequestBuilder.setXsrfToken(null); operation.getCallback().onFailure(operation, exception); } @Override public void onSuccess(final QueryReturnValue result) { operation.getCallback().onSuccess(operation, result); } }); }
@Override public void serviceFound(GenericApiGWTServiceAsync service) { service.runAction((ActionType) operation.getOperation(), (ActionParametersBase) operation.getParameter(), new AsyncCallback<ActionReturnValue>() { @Override public void onFailure(final Throwable exception) { //Clear out the token, and let the retry mechanism try again. xsrfRequestBuilder.setXsrfToken(null); operation.getCallback().onFailure(operation, exception); } @Override public void onSuccess(final ActionReturnValue result) { operation.getCallback().onSuccess(operation, result); } }); }
for (VdcOperation<?, ?> operation: allActionOperations) { runOnlyIfAllValidationPass = operation.isRunOnlyIfAllValidationPass(); parameters.add((ActionParametersBase) operation.getParameter());
/** * Copy constructor that allows for a different callback. * @param sourceOperation The source {@code VdcOperation} object. * @param callback The new callback method. */ public VdcOperation(final VdcOperation<T, P> sourceOperation, final VdcOperationCallback<?, ?> callback) { this(sourceOperation.getOperation(), sourceOperation.getParameter(), callback, sourceOperation, sourceOperation.isPublic(), sourceOperation.isFromList, sourceOperation.isRunOnlyIfAllValidationPass()); }
} else { queryTypes.add((QueryType) operation.getOperation()); parameters.add((QueryParametersBase) operation.getParameter());