Search in sources :

Example 1 with FileVirtualPoolUpdateBuilder

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

the class FileVirtualPoolForm method doSave.

protected FileVirtualPoolRestRep doSave() {
    FileVirtualPoolRestRep virtualPool;
    if (isNew()) {
        FileVirtualPoolBuilder builder = apply(new FileVirtualPoolBuilder());
        virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
        this.id = ResourceUtils.stringId(virtualPool);
    } else {
        FileVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getFileVirtualPool(id);
        FileVirtualPoolUpdateBuilder builder = apply(new FileVirtualPoolUpdateBuilder(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 : FileVirtualPoolRestRep(com.emc.storageos.model.vpool.FileVirtualPoolRestRep) FileVirtualPoolUpdateBuilder(util.builders.FileVirtualPoolUpdateBuilder) FileVirtualPoolBuilder(util.builders.FileVirtualPoolBuilder) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Aggregations

NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 FileVirtualPoolRestRep (com.emc.storageos.model.vpool.FileVirtualPoolRestRep)1 FileVirtualPoolBuilder (util.builders.FileVirtualPoolBuilder)1 FileVirtualPoolUpdateBuilder (util.builders.FileVirtualPoolUpdateBuilder)1