Search in sources :

Example 1 with StringComparator

use of com.emc.sa.util.StringComparator in project coprhd-controller by CoprHD.

the class BlockProvider method getVolumeFilter.

@Asset("sourceVolumeFilter")
@AssetDependencies({ "project", "blockVirtualPool" })
public List<AssetOption> getVolumeFilter(AssetOptionsContext ctx, URI projectId, URI virtualPoolId) {
    List<String> volumeNames = Lists.newArrayList();
    for (VolumeRestRep volume : listSourceVolumes(api(ctx), projectId, new VirtualPoolFilter(virtualPoolId))) {
        volumeNames.add(volume.getName());
    }
    Collections.sort(volumeNames, new StringComparator(false));
    return VirtualDataCenterProvider.getVolumeFilterOptions(volumeNames);
}
Also used : VplexVolumeVirtualPoolFilter(com.emc.vipr.client.core.filters.VplexVolumeVirtualPoolFilter) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) StringComparator(com.emc.sa.util.StringComparator) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 2 with StringComparator

use of com.emc.sa.util.StringComparator in project coprhd-controller by CoprHD.

the class VirtualDataCenterProvider method getUnmanagedVolumeFilter.

@Asset("volumeFilter")
@AssetDependencies({ "host", "unmanagedBlockVirtualPool" })
public List<AssetOption> getUnmanagedVolumeFilter(AssetOptionsContext ctx, URI host, URI vpool) {
    List<String> volumeNames = Lists.newArrayList();
    for (UnManagedVolumeRestRep volume : listUnmanagedVolumesByHost(ctx, host)) {
        if (matchesVpool(volume, vpool)) {
            volumeNames.add(getLabel(volume));
        }
    }
    Collections.sort(volumeNames, new StringComparator(false));
    return getVolumeFilterOptions(volumeNames);
}
Also used : UnManagedVolumeRestRep(com.emc.storageos.model.block.UnManagedVolumeRestRep) StringComparator(com.emc.sa.util.StringComparator) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 3 with StringComparator

use of com.emc.sa.util.StringComparator in project coprhd-controller by CoprHD.

the class VirtualDataCenterProvider method getVolumeFilter.

@Asset("volumeFilter")
@AssetDependencies({ "unmanagedBlockStorageSystem", "blockVirtualPool" })
public List<AssetOption> getVolumeFilter(AssetOptionsContext ctx, URI storageSystemId, URI vpool) {
    List<String> volumeNames = Lists.newArrayList();
    for (UnManagedVolumeRestRep volume : listUnmanagedVolumes(ctx, storageSystemId, vpool)) {
        if (!isNonRPExported(volume.getVolumeCharacteristics())) {
            volumeNames.add(getLabel(volume));
        }
    }
    Collections.sort(volumeNames, new StringComparator(false));
    return getVolumeFilterOptions(volumeNames);
}
Also used : UnManagedVolumeRestRep(com.emc.storageos.model.block.UnManagedVolumeRestRep) StringComparator(com.emc.sa.util.StringComparator) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Aggregations

Asset (com.emc.sa.asset.annotation.Asset)3 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)3 StringComparator (com.emc.sa.util.StringComparator)3 UnManagedVolumeRestRep (com.emc.storageos.model.block.UnManagedVolumeRestRep)2 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)1 VplexVolumeVirtualPoolFilter (com.emc.vipr.client.core.filters.VplexVolumeVirtualPoolFilter)1