use of com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionUpdateParam in project coprhd-controller by CoprHD.
the class PlacementPolicyValidator method validateProtection.
/**
* Validates protection
* Array affinity policy cannot be used for VPool with RP or remote copies
*
* @param protectionParam BlockVirtualPoolProtectionUpdateParam
* @param vPool Virtual Pool (null for creating new virtual pool, or validating current value is not necessary)
*/
private void validateProtection(BlockVirtualPoolProtectionUpdateParam protectionParam, VirtualPool vPool) {
if (protectionParam != null) {
VirtualPoolProtectionRPChanges rpChanges = protectionParam.getRecoverPoint();
if (rpChanges != null) {
if ((rpChanges.getAdd() != null && !rpChanges.getAdd().isEmpty()) || (rpChanges.getRemove() != null && !rpChanges.getRemove().isEmpty()) || rpChanges.getSourcePolicy() != null) {
throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
}
}
VirtualPoolRemoteProtectionUpdateParam remoteCopies = protectionParam.getRemoteCopies();
if (remoteCopies != null) {
if ((remoteCopies.getAdd() != null && !remoteCopies.getAdd().isEmpty()) || (remoteCopies.getRemove() != null && !remoteCopies.getRemove().isEmpty())) {
throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
}
}
} else if (vPool != null) {
if (VirtualPool.vPoolSpecifiesProtection(vPool) || VirtualPool.vPoolSpecifiesSRDF(vPool)) {
throw APIException.badRequests.arrayAffinityPlacementPolicyNotAllowedForRPOrRemoteCopies();
}
}
}
use of com.emc.storageos.model.vpool.VirtualPoolRemoteProtectionUpdateParam in project coprhd-controller by CoprHD.
the class BlockVirtualPoolUpdateBuilder method disableRemoteCopies.
public BlockVirtualPoolUpdateBuilder disableRemoteCopies() {
getProtection().setRemoteCopies(new VirtualPoolRemoteProtectionUpdateParam());
Set<VirtualPoolRemoteProtectionVirtualArraySettingsParam> noCopies = Sets.newHashSet();
setRemoteCopies(noCopies);
return this;
}
Aggregations