use of util.builders.BlockVirtualPoolUpdateBuilder in project coprhd-controller by CoprHD.
the class BlockVirtualPoolForm method doSave.
protected BlockVirtualPoolRestRep doSave() {
BlockVirtualPoolRestRep virtualPool;
if (isNew()) {
BlockVirtualPoolBuilder builder = apply(new BlockVirtualPoolBuilder());
virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
this.id = ResourceUtils.stringId(virtualPool);
} else {
BlockVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
BlockVirtualPoolUpdateBuilder builder = apply(new BlockVirtualPoolUpdateBuilder(oldVirtualPool));
virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
List<NamedRelatedResourceRep> matchingPools = VirtualPoolUtils.refreshMatchingPools(virtualPool);
Logger.info("Refreshed Block Virtual Pool '%s' matching pools: %d", virtualPool.getName(), matchingPools.size());
}
virtualPool = saveStoragePools(virtualPool);
return virtualPool;
}
Aggregations