Search in sources :

Example 1 with StoragePort

use of com.emc.storageos.vasa.data.internal.StoragePort in project coprhd-controller by CoprHD.

the class SyncManager method fetchStoragePortsByHostInitiators.

private List<StoragePort> fetchStoragePortsByHostInitiators(String csvSeparatedInitiatorList) throws SOSFailure {
    final String methodName = "fetchStoragePortsByHostInitiators(): ";
    log.trace(methodName + "Entry with input: csvSeparatedInitiatorList[" + csvSeparatedInitiatorList + "]");
    Set<String> storagePortLinkSet = new HashSet<String>();
    List<StoragePort> storagePortList = new ArrayList<StoragePort>();
    for (Itls itlObj : this.fetchExportITLS(csvSeparatedInitiatorList)) {
        if (itlObj != null) {
            for (Itl itl : itlObj.getItls()) {
                Target target = itl.getTarget();
                if (target != null && target.getId() != null) {
                    storagePortLinkSet.add(target.getLink().getHref());
                }
            }
        }
    }
    // try {
    if (storagePortLinkSet != null) {
        for (String storagePortLink : storagePortLinkSet) {
            StoragePort storagePort = this.fetchStoragePortByHref(storagePortLink);
            storagePortList.add(storagePort);
        }
    }
    log.trace(methodName + "Exit returning storage port list of size[" + storagePortList.size() + "]");
    return new ArrayList<StoragePort>(storagePortList);
}
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) StoragePort(com.emc.storageos.vasa.data.internal.StoragePort) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet)

Example 2 with StoragePort

use of com.emc.storageos.vasa.data.internal.StoragePort in project coprhd-controller by CoprHD.

the class SyncManager method fetchStoragePortByHref.

private StoragePort fetchStoragePortByHref(String href) throws SOSFailure {
    final String methodName = "fetchStoragePortByHref(): ";
    log.trace(methodName + "Entry with input: href[" + href + "]");
    StoragePort storagePort = null;
    try {
        storagePort = _client.queryObject(href, StoragePort.class);
        if (storagePort == null) {
            storagePort = new StoragePort();
        }
    } catch (NoSuchAlgorithmException e) {
        log.error(methodName + "NoSuchAlgorithmException occured", e);
        throw new SOSFailure(e);
    } catch (UniformInterfaceException e) {
        log.error(methodName + "UniformInterfaceException occured", e);
        throw new SOSFailure(e);
    }
    log.trace(methodName + "Exit returning storage port :[" + storagePort + "]");
    return storagePort;
}
Also used : UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) StoragePort(com.emc.storageos.vasa.data.internal.StoragePort) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Example 3 with StoragePort

use of com.emc.storageos.vasa.data.internal.StoragePort in project coprhd-controller by CoprHD.

the class SyncManager method fetchStoragePort.

private StoragePort fetchStoragePort(String storageSystemId, String storagePortId) throws SOSFailure {
    final String methodName = "fetchStoragePort(): ";
    log.trace(methodName + "Entry with input: storageSystemId[" + storageSystemId + "] storagePortId[" + storagePortId + "]");
    StoragePort storagePort = null;
    final String STORAGE_PORT_DETAIL_URI1 = "/vdc/storage-systems/%s/storage-ports/%s";
    final String STORAGE_PORT_DETAIL_URI2 = "/vdc/storage-ports/%s";
    if (null == storageSystemId) {
        storagePort = this.fetchStoragePortByHref(String.format(STORAGE_PORT_DETAIL_URI2, storagePortId));
    } else {
        storagePort = this.fetchStoragePortByHref(String.format(STORAGE_PORT_DETAIL_URI1, storageSystemId, storagePortId));
    }
    log.trace(methodName + "Exit returning storage port :[" + storagePort + "]");
    return storagePort;
}
Also used : StoragePort(com.emc.storageos.vasa.data.internal.StoragePort)

Aggregations

StoragePort (com.emc.storageos.vasa.data.internal.StoragePort)3 Itls (com.emc.storageos.vasa.data.internal.Volume.Itls)1 Itl (com.emc.storageos.vasa.data.internal.Volume.Itls.Itl)1 Target (com.emc.storageos.vasa.data.internal.Volume.Itls.Itl.Target)1 SOSFailure (com.emc.storageos.vasa.fault.SOSFailure)1 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1