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(); } }
public void prepare2() { PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment; ActionReturnValue returnValue = context.changeVDSClusterReturnValue; context.enlistment = null; if (returnValue != null && returnValue.getSucceeded()) { enlistment.prepared(); } else { enlistment.forceRollback(); } }
private void prepare3() { PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment; EnlistmentContext enlistmentContext = (EnlistmentContext) enlistment.getContext(); ActionReturnValue returnValue = context.addDataCenterReturnValue; context.enlistment = null; if (returnValue != null && returnValue.getSucceeded()) { enlistmentContext.setDataCenterId((Guid) returnValue.getActionReturnValue()); enlistment.prepared(); } else { enlistment.forceRollback(); } }
private void prepare3() { PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment; EnlistmentContext enlistmentContext = (EnlistmentContext) enlistment.getContext(); ActionReturnValue returnValue = context.addClusterReturnValue; context.enlistment = null; if (returnValue != null && returnValue.getSucceeded()) { enlistmentContext.setClusterId((Guid) returnValue.getActionReturnValue()); context.enlistment = null; enlistment.prepared(); } else { enlistment.forceRollback(); } }
public void prepare1() { PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment; EnlistmentContext enlistmentContext = (EnlistmentContext) context.enlistment.getContext(); HostListModel<?> model = enlistmentContext.getModel(); VDS host = model.getSelectedItem(); if (!enlistmentContext.getClusterId().equals(host.getClusterId())) { enlistmentContext.setOldClusterId(host.getClusterId()); ChangeVDSClusterParameters parameters = new ChangeVDSClusterParameters(enlistmentContext.getClusterId(), host.getId()); parameters.setCorrelationId(getCorrelationId()); Frontend.getInstance().runAction(ActionType.ChangeVDSCluster, parameters, result -> { ActionReturnValue returnValue = result.getReturnValue(); context.changeVDSClusterReturnValue = returnValue; prepare2(); }); } else { context.enlistment = null; enlistment.prepared(); } }