use of com.emc.storageos.db.client.model.ComputeElement in project coprhd-controller by CoprHD.
the class ComputeVirtualPoolService method getURIs.
private List<URI> getURIs(Collection<ComputeElement> elements) throws APIException {
List<URI> uriList = new ArrayList<URI>();
if (elements == null || elements.isEmpty()) {
return uriList;
}
for (ComputeElement element : elements) {
URI uri = element.getId();
uriList.add(uri);
}
return uriList;
}
use of com.emc.storageos.db.client.model.ComputeElement in project coprhd-controller by CoprHD.
the class ComputeVirtualPoolService method removeHostToCVPRelation.
private void removeHostToCVPRelation(Collection<ComputeElement> removeElements, ComputeVirtualPool cvp) {
List<Host> updatedHosts = Lists.newArrayList();
for (ComputeElement computeElement : removeElements) {
List<Host> hosts = CustomQueryUtility.queryActiveResourcesByConstraint(_dbClient, Host.class, ContainmentConstraint.Factory.getContainedObjectsConstraint(computeElement.getId(), Host.class, "computeElement"));
for (Host host : hosts) {
if (!NullColumnValueGetter.isNullURI(host.getComputeVirtualPoolId()) && host.getComputeVirtualPoolId().equals(cvp.getId())) {
host.setComputeVirtualPoolId(NullColumnValueGetter.getNullURI());
updatedHosts.add(host);
}
}
}
if (CollectionUtils.isNotEmpty(updatedHosts)) {
_dbClient.updateObject(updatedHosts);
}
}
Aggregations