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);
}
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;
}
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;
}
Aggregations