Search in sources :

Example 1 with BlockVirtualPoolUpdateBuilder

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;
}
Also used : BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) BlockVirtualPoolUpdateBuilder(util.builders.BlockVirtualPoolUpdateBuilder) BlockVirtualPoolBuilder(util.builders.BlockVirtualPoolBuilder)

Aggregations

NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)1 BlockVirtualPoolBuilder (util.builders.BlockVirtualPoolBuilder)1 BlockVirtualPoolUpdateBuilder (util.builders.BlockVirtualPoolUpdateBuilder)1