com.emc.storageos.model.block.BlockConsistencyGroupUpdate Maven / Gradle / Ivy
/*
* Copyright (c) 2013 EMC Corporation
* All Rights Reserved
*/
package com.emc.storageos.model.block;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* Consistency group update parameters
*/
@XmlRootElement(name = "consistency_group_update")
public class BlockConsistencyGroupUpdate {
public static class BlockConsistencyGroupVolumeList {
private List volumes;
/**
* A block volume URI
*
* @valid none
*/
@XmlElement(required = true, name = "volume")
public List getVolumes() {
if (volumes == null) {
volumes = new ArrayList();
}
return volumes;
}
public void setVolumes(List volumes) {
this.volumes = volumes;
}
}
private BlockConsistencyGroupVolumeList addVolumesList;
private BlockConsistencyGroupVolumeList removeVolumesList;
/**
* List of volumes to add to the block consistency group
*
* @valid none
*/
@XmlElement(name = "add_volumes")
public BlockConsistencyGroupVolumeList getAddVolumesList() {
return addVolumesList;
}
public void setAddVolumesList(BlockConsistencyGroupVolumeList addVolumesList) {
this.addVolumesList = addVolumesList;
}
/**
* List of volumes to remove from the block consistency group
*
* @valid none
*/
@XmlElement(name = "remove_volumes")
public BlockConsistencyGroupVolumeList getRemoveVolumesList() {
return removeVolumesList;
}
public void setRemoveVolumesList(
BlockConsistencyGroupVolumeList removeVolumesList) {
this.removeVolumesList = removeVolumesList;
}
public boolean hasEitherAddOrRemoveVolumes() {
return hasVolumesToAdd() || hasVolumesToRemove();
}
public boolean hasBothAddAndRemoveVolumes() {
return hasVolumesToAdd() && hasVolumesToRemove();
}
public boolean hasVolumesToAdd() {
return addVolumesList != null && addVolumesList.volumes != null &&
!addVolumesList.volumes.isEmpty();
}
public boolean hasVolumesToRemove() {
return removeVolumesList != null && removeVolumesList.volumes != null &&
!removeVolumesList.volumes.isEmpty();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy