use of com.emc.storageos.model.network.FCZoneReferences in project coprhd-controller by CoprHD.
the class NetworkSystemService method getReferences.
/**
* This information is intended only for internal debugging.
* The FCZoneReference structure represents a use of a SAN Zone by an ExportGroup/Volume
* combination. This call allows one to check what ExportGroups/Volumes are using a given
* SAN Zone.
* Gets the FCZoneReference entries for a given wwnList (used to make the key).
*
* @param wwnList A comma separated list of wwn Zone members is used to make the search key.
* @brief INTERNAL ONLY
* @return FCZoneReferences a list of FCZoneReference structures
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/san-references/{wwnList}")
@CheckPermission(roles = { Role.SYSTEM_ADMIN })
public FCZoneReferences getReferences(@PathParam("wwnList") String wwnList) {
FCZoneReferences references = new FCZoneReferences();
List<String> wwns = Arrays.asList(wwnList.split(","));
for (int i = 0; i < wwns.size() - 1; i++) {
for (int j = i + 1; j < wwns.size(); j++) {
String key = FCZoneReference.makeEndpointsKey(Arrays.asList(new String[] { wwns.get(i).toUpperCase(), wwns.get(j).toUpperCase() }));
List<URI> uris = _dbClient.queryByConstraint(AlternateIdConstraint.Factory.getFCZoneReferenceKeyConstraint(key));
for (URI uri : uris) {
FCZoneReference ref = _dbClient.queryObject(FCZoneReference.class, uri);
if (ref != null) {
if (ref.getInactive() == false) {
Volume vol = _dbClient.queryObject(Volume.class, ref.getVolumeUri());
if (vol != null && vol.getInactive() == false) {
references.getReferences().add(map(ref));
}
}
}
}
}
}
return references;
}
Aggregations