Source:
protected boolean validate() { if (!super.validate()) { return false; } if (getParameters().getBricks() == null || getParameters().getBricks().size() == 0) { failValidation(EngineMessage.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } if (getGlusterVolume().getVolumeType().isReplicatedType()) { if (getParameters().getReplicaCount() > getGlusterVolume().getReplicaCount() + 1) { failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT_MORE_THAN_ONE); } else if (getParameters().getReplicaCount() < getGlusterVolume().getReplicaCount()) { failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_REPLICA_COUNT); } } if (getGlusterVolume().getVolumeType().isStripedType()) { if (getParameters().getStripeCount() > getGlusterVolume().getStripeCount() + 1) { failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_STRIPE_COUNT_MORE_THAN_ONE); } else if (getParameters().getStripeCount() < getGlusterVolume().getStripeCount()) { failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_STRIPE_COUNT); } } if (getGlusterVolume().getVolumeType().isDispersedType()) { failValidation(EngineMessage.ACTION_TYPE_FAILED_ADD_BRICK_TO_DISPERSE_VOLUME_NOT_SUPPORTED); } boolean ret = updateBrickServerAndInterfaceNames(getParameters().getBricks(), true) && validateDuplicateBricks(getParameters().getBricks()); if (getCluster().supportsGlusterService() && getCluster().supportsVirtService() && getGlusterVolume().getVolumeType().isReplicatedType()) { ret = ret && validateNotSameServer(getParameters().getBricks(), getGlusterVolume(), getParameters().getReplicaCount()); } return ret; }

Target:
protected boolean validate() { if (!super.validate()) { return false; } if (getParameters().getBricks() == null || getParameters().getBricks().size() == 0) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } if (getGlusterVolume().getVolumeType().isReplicatedType()) { if (getParameters().getReplicaCount() > getGlusterVolume().getReplicaCount() + 1) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT_MORE_THAN_ONE); } else if (getParameters().getReplicaCount() < getGlusterVolume().getReplicaCount()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_REPLICA_COUNT); } } if (getGlusterVolume().getVolumeType().isStripedType()) { if (getParameters().getStripeCount() > getGlusterVolume().getStripeCount() + 1) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_STRIPE_COUNT_MORE_THAN_ONE); } else if (getParameters().getStripeCount() < getGlusterVolume().getStripeCount()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_STRIPE_COUNT); } } if (getGlusterVolume().getVolumeType().isDispersedType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_ADD_BRICK_TO_DISPERSE_VOLUME_NOT_SUPPORTED); } boolean ret = updateBrickServerAndInterfaceNames(getParameters().getBricks(), true) && validateDuplicateBricks(getParameters().getBricks()); if (getCluster().supportsGlusterService() && getCluster().supportsVirtService() && getGlusterVolume().getVolumeType().isReplicatedType()) { ret = ret && validateNotSameServer(getParameters().getBricks(), getGlusterVolume(), getParameters().getReplicaCount()); } return ret; }