use of com.emc.vipr.client.core.util.RelatedResourceComparator in project coprhd-controller by CoprHD.
the class StorageSystemUtils method mapProtectionSystemConnectivity.
private static Map<String, Set<NamedRelatedResourceRep>> mapProtectionSystemConnectivity(List<StorageSystemConnectivityRestRep> connectivityList) {
Map<String, Set<NamedRelatedResourceRep>> results = Maps.newTreeMap();
for (StorageSystemConnectivityRestRep connectivity : connectivityList) {
for (String connectionType : connectivity.getConnectionTypes()) {
if (connectivity.getProtectionSystem() == null) {
continue;
}
Set<NamedRelatedResourceRep> values = results.get(connectionType);
if (values == null) {
values = Sets.newTreeSet(new RelatedResourceComparator());
results.put(connectionType, values);
}
values.add(connectivity.getProtectionSystem());
}
}
return results;
}
use of com.emc.vipr.client.core.util.RelatedResourceComparator in project coprhd-controller by CoprHD.
the class VirtualArrays method findByInitiators.
/**
* Finds the list of virtual arrays connected to any of the given initiators, optionally filtering the results.
*
* @param initiators
* the initiators.
* @param filter
* the resource filter to apply to the results as they are returned (optional).
* @return the list of connected virtual arrays.
*/
public List<VirtualArrayRestRep> findByInitiators(Collection<InitiatorRestRep> initiators, ResourceFilter<VirtualArrayRestRep> filter) {
// Collect unique virtual array refs before fetching
Set<RelatedResourceRep> virtualArrayRefs = new TreeSet<RelatedResourceRep>(new RelatedResourceComparator());
for (InitiatorRestRep initiator : initiators) {
String port = initiator.getInitiatorPort();
virtualArrayRefs.addAll(performSearchBy(SearchConstants.INITIATOR_PORT_PARAM, port));
}
return getByRefs(virtualArrayRefs, filter);
}
Aggregations