Search in sources :

Example 1 with ObjectVirtualPoolUpdateBuilder

use of util.builders.ObjectVirtualPoolUpdateBuilder in project coprhd-controller by CoprHD.

the class ObjectVirtualPoolForm method doSave.

protected ObjectVirtualPoolRestRep doSave() {
    ObjectVirtualPoolRestRep virtualPool;
    if (isNew()) {
        ObjectVirtualPoolBuilder builder = apply(new ObjectVirtualPoolBuilder());
        virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
        this.id = ResourceUtils.stringId(virtualPool);
    } else {
        ObjectVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getObjectVirtualPool(id);
        ObjectVirtualPoolUpdateBuilder builder = apply(new ObjectVirtualPoolUpdateBuilder(oldVirtualPool));
        virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
        List<NamedRelatedResourceRep> matchingPools = VirtualPoolUtils.refreshMatchingPools(virtualPool);
        Logger.info("Refreshed File Virtual Pool '%s' matching pools: %d", virtualPool.getName(), matchingPools.size());
    }
    virtualPool = saveStoragePools(virtualPool);
    return virtualPool;
}
Also used : ObjectVirtualPoolBuilder(util.builders.ObjectVirtualPoolBuilder) ObjectVirtualPoolUpdateBuilder(util.builders.ObjectVirtualPoolUpdateBuilder) ObjectVirtualPoolRestRep(com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Aggregations

NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 ObjectVirtualPoolRestRep (com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep)1 ObjectVirtualPoolBuilder (util.builders.ObjectVirtualPoolBuilder)1 ObjectVirtualPoolUpdateBuilder (util.builders.ObjectVirtualPoolUpdateBuilder)1