Search in sources :

Example 1 with ObjectVirtualPoolBuilder

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

the class ObjectVirtualPoolForm method matchingStoragePools.

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

Example 2 with ObjectVirtualPoolBuilder

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

ObjectVirtualPoolBuilder (util.builders.ObjectVirtualPoolBuilder)2 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 ObjectVirtualPoolRestRep (com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep)1 MatchingObjectStoragePoolsCall (jobs.vipr.MatchingObjectStoragePoolsCall)1 ObjectVirtualPoolUpdateBuilder (util.builders.ObjectVirtualPoolUpdateBuilder)1