Search in sources :

Example 1 with FileVirtualPoolBuilder

use of util.builders.FileVirtualPoolBuilder 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)

Example 2 with FileVirtualPoolBuilder

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

the class FileVirtualPoolForm method matchingStoragePools.

public MatchingFileStoragePoolsCall matchingStoragePools() {
    FileVirtualPoolBuilder builder = new FileVirtualPoolBuilder();
    apply(builder);
    builder.setUseMatchedPools(true);
    return new MatchingFileStoragePoolsCall(builder.getVirtualPool());
}
Also used : FileVirtualPoolBuilder(util.builders.FileVirtualPoolBuilder) MatchingFileStoragePoolsCall(jobs.vipr.MatchingFileStoragePoolsCall)

Aggregations

FileVirtualPoolBuilder (util.builders.FileVirtualPoolBuilder)2 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 FileVirtualPoolRestRep (com.emc.storageos.model.vpool.FileVirtualPoolRestRep)1 MatchingFileStoragePoolsCall (jobs.vipr.MatchingFileStoragePoolsCall)1 FileVirtualPoolUpdateBuilder (util.builders.FileVirtualPoolUpdateBuilder)1