Search in sources :

Example 1 with BackendLocal

use of org.ovirt.engine.core.common.interfaces.BackendLocal in project ovirt-engine by oVirt.

the class BackendResource method doNonBlockingAction.

protected void doNonBlockingAction(final ActionType task, final ActionParametersBase params) {
    BackendLocal backend = getBackend();
    setCorrelationId(params);
    setJobOrStepId(params);
    backend.runAction(ActionType.RunAsyncAction, sessionize(new RunAsyncActionParameters(task, sessionize(params))));
}
Also used : BackendLocal(org.ovirt.engine.core.common.interfaces.BackendLocal) RunAsyncActionParameters(org.ovirt.engine.core.common.action.RunAsyncActionParameters)

Example 2 with BackendLocal

use of org.ovirt.engine.core.common.interfaces.BackendLocal in project ovirt-engine by oVirt.

the class BackendResource method doAction.

protected ActionReturnValue doAction(ActionType task, ActionParametersBase params) throws BackendFailureException {
    BackendLocal backend = getBackend();
    setJobOrStepId(params);
    setCorrelationId(params);
    ActionReturnValue result = backend.runAction(task, sessionize(params));
    if (result != null && !result.isValid()) {
        backendFailure(result.getValidationMessages());
    } else if (result != null && !result.getSucceeded()) {
        backendFailure(result.getExecuteFailedMessages());
    }
    assert result != null;
    return result;
}
Also used : ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) BackendLocal(org.ovirt.engine.core.common.interfaces.BackendLocal)

Example 3 with BackendLocal

use of org.ovirt.engine.core.common.interfaces.BackendLocal in project ovirt-engine by oVirt.

the class BackendResource method runQuery.

public QueryReturnValue runQuery(QueryType queryType, QueryParametersBase queryParams) {
    BackendLocal backend = getBackend();
    setCorrelationId(queryParams);
    queryParams.setFiltered(isFiltered());
    return backend.runQuery(queryType, sessionize(queryParams));
}
Also used : BackendLocal(org.ovirt.engine.core.common.interfaces.BackendLocal)

Example 4 with BackendLocal

use of org.ovirt.engine.core.common.interfaces.BackendLocal in project ovirt-engine by oVirt.

the class BaseBackendResource method localize.

protected String localize(String error) {
    BackendLocal backend = getBackend();
    Locale locale = getEffectiveLocale();
    return locale != null ? backend.getErrorsTranslator().translateErrorTextSingle(error, locale) : backend.getErrorsTranslator().translateErrorTextSingle(error);
}
Also used : Locale(java.util.Locale) BackendLocal(org.ovirt.engine.core.common.interfaces.BackendLocal)

Example 5 with BackendLocal

use of org.ovirt.engine.core.common.interfaces.BackendLocal in project ovirt-engine by oVirt.

the class BaseBackendResource method localize.

protected String localize(List<String> errors) {
    BackendLocal backend = getBackend();
    Locale locale = getEffectiveLocale();
    return locale != null ? backend.getErrorsTranslator().translateErrorText(errors, locale).toString() : backend.getErrorsTranslator().translateErrorText(errors).toString();
}
Also used : Locale(java.util.Locale) BackendLocal(org.ovirt.engine.core.common.interfaces.BackendLocal)

Aggregations

BackendLocal (org.ovirt.engine.core.common.interfaces.BackendLocal)5 Locale (java.util.Locale)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 RunAsyncActionParameters (org.ovirt.engine.core.common.action.RunAsyncActionParameters)1