Search in sources :

Example 1 with Device

use of com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Device in project coprhd-controller by CoprHD.

the class SyncManager method fetchPortToVolumeTable.

private Hashtable<String, List<String>> fetchPortToVolumeTable(String csvSeparatedInitiatorList) throws SOSFailure {
    final String methodName = "fetchPortToVolumeTable(): ";
    log.trace(methodName + "Entry with input: csvSeparatedInitiatorList[" + csvSeparatedInitiatorList + "]");
    // Hashtable<String, String> table = new Hashtable<String, String>();
    Hashtable<String, List<String>> table2 = new Hashtable<String, List<String>>();
    for (Itls itlObj : this.fetchExportITLS(csvSeparatedInitiatorList)) {
        if (itlObj != null) {
            for (Itl itl : itlObj.getItls()) {
                Target target = itl.getTarget();
                String portId = target.getId();
                if (portId != null) {
                    Set<String> volIds = new HashSet<String>();
                    for (Itl itl2 : itlObj.getItls()) {
                        Target port = itl2.getTarget();
                        Device volume = itl2.getDevice();
                        if (portId.equals(port.getId())) {
                            volIds.add(volume.getId());
                        }
                    }
                    table2.put(portId, new ArrayList<String>(volIds));
                }
            }
        }
    }
    log.trace(methodName + "Exit returning port-volume table of size[" + table2.size() + "]");
    return table2;
}
Also used : Itls(com.emc.storageos.vasa.data.internal.Volume.Itls) Itl(com.emc.storageos.vasa.data.internal.Volume.Itls.Itl) Target(com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Target) Hashtable(java.util.Hashtable) Device(com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Device) ArrayList(java.util.ArrayList) CoSList(com.emc.storageos.vasa.data.internal.CoS.CoSList) EventList(com.emc.storageos.vasa.data.internal.Event.EventList) List(java.util.List) StatList(com.emc.storageos.vasa.data.internal.StatList) HashSet(java.util.HashSet)

Example 2 with Device

use of com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Device in project coprhd-controller by CoprHD.

the class SyncManager method fetchVolumeIdsByHostInitiators.

private List<String> fetchVolumeIdsByHostInitiators(String csvSeparatedInitiatorList) throws SOSFailure {
    final String methodName = "fetchVolumeIdsByHostInitiators(): ";
    log.trace(methodName + "Entry with input: csvSeparatedInitiatorList[" + csvSeparatedInitiatorList + "]");
    Set<String> volumeIdSet = new HashSet<String>();
    for (Itls itlObj : this.fetchExportITLS(csvSeparatedInitiatorList)) {
        if (itlObj != null) {
            for (Itl itl : itlObj.getItls()) {
                Device device = itl.getDevice();
                if (device != null && device.getId() != null) {
                    volumeIdSet.add(device.getId());
                }
            }
        }
    }
    log.trace(methodName + "Exit returning volume ID list of size[" + volumeIdSet.size() + "]");
    return new ArrayList<String>(volumeIdSet);
}
Also used : Itls(com.emc.storageos.vasa.data.internal.Volume.Itls) Itl(com.emc.storageos.vasa.data.internal.Volume.Itls.Itl) Device(com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Device) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet)

Aggregations

Itls (com.emc.storageos.vasa.data.internal.Volume.Itls)2 Itl (com.emc.storageos.vasa.data.internal.Volume.Itls.Itl)2 Device (com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Device)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 CoSList (com.emc.storageos.vasa.data.internal.CoS.CoSList)1 EventList (com.emc.storageos.vasa.data.internal.Event.EventList)1 StatList (com.emc.storageos.vasa.data.internal.StatList)1 Target (com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Target)1 Hashtable (java.util.Hashtable)1 List (java.util.List)1