use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchDetailsOfAllBlockCos.
/**
* Returns list of all active Block related CoSes with their details
*
* @return list of all active Block related CoSes with their details
* @throws SOSFailure
*/
private List<CoS> fetchDetailsOfAllBlockCos() throws SOSFailure {
final String methodName = "fetchDetailsOfAllBlockCos(): ";
log.trace(methodName + "Entry");
final String BLOCK_COS_DETAIL_URI = "/block/vpools/%s";
List<CoS> blockCosIdList = new ArrayList<CoS>();
try {
for (String cosId : _blockCosIdList) {
CoS.BlockCoS cos = _client.queryObject(String.format(BLOCK_COS_DETAIL_URI, cosId), CoS.BlockCoS.class);
if (cos.isInactive() == false && cos.getId() != null) {
blockCosIdList.add(cos);
log.trace(methodName + cos);
}
}
log.trace(methodName + "Exit returning cos list of size[" + blockCosIdList.size() + "]");
return blockCosIdList;
} 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);
}
}
use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchFileSystemExports.
private synchronized FileSystemExports fetchFileSystemExports(String fileSystemID) throws SOSFailure {
final String methodName = "fetchFileSystemExports(): ";
log.trace(methodName + "Entry with fileSystemID[" + fileSystemID + "]");
final String FS_EXPORT_DETAIL_URI = "/file/filesystems/%s/exports";
FileSystemExports exports = null;
try {
exports = _client.queryObject(String.format(FS_EXPORT_DETAIL_URI, fileSystemID), FileSystemExports.class);
} 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: " + exports);
return exports;
}
use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchFileSystemIdByMountPath.
private String fetchFileSystemIdByMountPath(String mountPath) throws SOSFailure {
final String methodName = "fetchFileSystemIdByMountPath(): ";
final String FILESYSTEM_SEARCH_BY_MOUNTPATH = "/file/filesystems/search?mountPath=%s";
log.trace(methodName + "Entry with input: mountPath[" + mountPath + "]");
String filesystemId = null;
try {
SearchResults results = _client.queryObject(String.format(FILESYSTEM_SEARCH_BY_MOUNTPATH, mountPath), FileShare.SearchResults.class);
if (results != null) {
AssociatedResource resouce = results.getResource();
if (resouce != null) {
String tempFilesystemId = resouce.getId();
FileSystemExports exports = fetchFileSystemExports(tempFilesystemId);
if (exports != null && exports.getFsExportList() != null && !exports.getFsExportList().isEmpty()) {
filesystemId = tempFilesystemId;
}
}
}
} 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 filesystem ID[" + filesystemId + "]");
return filesystemId;
}
use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchDetailsOfAllFileCos.
/**
* Returns list of all active Block related CoSes with their details
*
* @return list of all active Block related CoSes with their details
* @throws SOSFailure
*/
private List<CoS> fetchDetailsOfAllFileCos() throws SOSFailure {
final String methodName = "fetchDetailsOfAllFileCos(): ";
log.trace(methodName + "Entry");
final String FILE_COS_DETAIL_URI = "/file/vpools/%s";
List<CoS> fileCosIdList = new ArrayList<CoS>();
try {
for (String cosId : _fileCosIdList) {
CoS.FileCoS cos = _client.queryObject(String.format(FILE_COS_DETAIL_URI, cosId), CoS.FileCoS.class);
if (cos.isInactive() == false && cos.getId() != null) {
fileCosIdList.add(cos);
log.trace(methodName + cos);
}
}
log.trace(methodName + "Exit returning cos list of size[" + fileCosIdList.size() + "]");
return fileCosIdList;
} 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);
}
}
use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchAssociatedPoolOfVolume.
public synchronized AssociatedPool fetchAssociatedPoolOfVolume(String volumeID) throws SOSFailure {
final String methodName = "fetchAssociatedPoolForVolume(): ";
log.trace(methodName + "Entry with volumeID[" + volumeID + "]");
final String ASSOCIATED_POOL_OF_VOLUME_URI = "/block/volumes/%s/storage-pool";
AssociatedPool associatedPool = null;
try {
associatedPool = _client.queryObject(String.format(ASSOCIATED_POOL_OF_VOLUME_URI, volumeID), Volume.AssociatedPool.class);
associatedPool = associatedPool.getStoragepool() == null ? null : associatedPool;
} 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 associated storage pool[" + associatedPool + "]");
return associatedPool;
}
Aggregations