use of com.emc.storageos.vasa.data.internal.FileShare.FileSystemExports 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.data.internal.FileShare.FileSystemExports 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;
}
Aggregations