use of com.emc.vipr.client.core.filters.IdFilter in project coprhd-controller by CoprHD.
the class StoragePoolUtils method getStoragePoolsAssignableToVirtualArray.
public static List<StoragePoolRestRep> getStoragePoolsAssignableToVirtualArray(String virtualArrayId) {
List<StoragePoolRestRep> assignedPools = getStoragePoolsAssignedToVirtualArray(virtualArrayId);
List<URI> ids = Lists.newArrayList();
for (StoragePoolRestRep pool : assignedPools) {
if ((pool.getAssignedVirtualArrays() != null) && pool.getAssignedVirtualArrays().contains(virtualArrayId)) {
ids.add(id(pool));
}
}
return getViprClient().storagePools().getAll(new IdFilter<StoragePoolRestRep>(ids).notId());
}
use of com.emc.vipr.client.core.filters.IdFilter in project coprhd-controller by CoprHD.
the class FindVirtualArrayInitiators method executeTask.
@Override
public Set<Initiator> executeTask() throws Exception {
IdFilter<VirtualArrayRestRep> filter = new IdFilter<VirtualArrayRestRep>(varray);
Set<Initiator> results = Sets.newHashSet();
for (Initiator initiator : initiators) {
String initiatorPort = initiator.getInitiatorPort();
List<VirtualArrayRestRep> virtualArrays = getClient().varrays().findByInitiatorPort(initiatorPort, filter);
// Filter will only return the virtual array we are searching for
if (!virtualArrays.isEmpty()) {
results.add(initiator);
}
}
return results;
}
Aggregations