use of org.ovirt.engine.core.common.action.ActionReturnValue in project ovirt-engine by oVirt.
the class AddDataCenterRM method rollback4.
private void rollback4() {
Enlistment enlistment = context.enlistment;
EnlistmentContext enlistmentContext = (EnlistmentContext) enlistment.getContext();
ActionReturnValue returnValue = context.changeVDSClusterReturnValue;
if (returnValue != null && returnValue.getSucceeded()) {
// Remove cluster.
if (enlistmentContext.getClusterId() != null) {
Frontend.getInstance().runAction(ActionType.RemoveCluster, new ClusterParametersBase(enlistmentContext.getClusterId()), result -> rollback5());
}
} else {
context.enlistment = null;
enlistment.done();
}
}
use of org.ovirt.engine.core.common.action.ActionReturnValue in project ovirt-engine by oVirt.
the class AddStorageDomainRM method prepare6.
private void prepare6() {
ActionReturnValue returnValue = context.addLocalStorageDomainReturnValue;
if (returnValue == null || !returnValue.getSucceeded()) {
StorageServerConnectionParametersBase parameter = new StorageServerConnectionParametersBase(context.connection, context.host.getId(), false);
parameter.setCorrelationId(getCorrelationId());
Frontend.getInstance().runAction(ActionType.DisconnectStorageServerConnection, parameter, result -> {
ActionReturnValue returnValue1 = result.getReturnValue();
context.removeStorageServerConnectionReturnValue = returnValue1;
prepare7();
});
} else {
prepare7();
}
}
use of org.ovirt.engine.core.common.action.ActionReturnValue in project ovirt-engine by oVirt.
the class AddStorageDomainRM method prepare2.
private void prepare2() {
PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment;
ActionReturnValue returnValue = context.activateVdsReturnValue;
if (returnValue == null || !returnValue.getSucceeded()) {
context.enlistment = null;
enlistment.forceRollback();
} else {
prepare3();
}
}
use of org.ovirt.engine.core.common.action.ActionReturnValue in project ovirt-engine by oVirt.
the class AddStorageDomainRM method prepare4.
private void prepare4() {
if (timer != null) {
timer.cancel();
timer = null;
}
PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment;
EnlistmentContext enlistmentContext = (EnlistmentContext) enlistment.getContext();
HostListModel<?> model = enlistmentContext.getModel();
ConfigureLocalStorageModel configureModel = (ConfigureLocalStorageModel) model.getWindow();
if (context.host.getStatus() != VDSStatus.Up) {
prepare3();
} else {
// Add storage domain.
StorageServerConnections connection = new StorageServerConnections();
connection.setConnection(configureModel.getStorage().getPath().getEntity());
connection.setStorageType(StorageType.LOCALFS);
context.connection = connection;
StorageServerConnectionParametersBase parameters = new StorageServerConnectionParametersBase(connection, context.host.getId(), false);
parameters.setCorrelationId(getCorrelationId());
Frontend.getInstance().runAction(ActionType.AddStorageServerConnection, parameters, result -> {
ActionReturnValue returnValue = result.getReturnValue();
context.addStorageServerConnectionReturnValue = returnValue;
prepare5();
});
}
}
use of org.ovirt.engine.core.common.action.ActionReturnValue in project ovirt-engine by oVirt.
the class AddStorageDomainRM method prepare7.
private void prepare7() {
PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment;
ActionReturnValue returnValue = context.removeStorageServerConnectionReturnValue;
context.enlistment = null;
// ReturnValue not equals null means remove connection occurred.
if (returnValue != null) {
// Don't rollback.
enlistment.done();
} else {
enlistment.prepared();
}
}
Aggregations