use of com.emc.storageos.db.client.constraint.ContainmentConstraint in project coprhd-controller by CoprHD.
the class ComputeSystemControllerImpl method getMountInfo.
public FileMountInfo getMountInfo(URI hostId, String mountPath, URI resId) {
ContainmentConstraint containmentConstraint = ContainmentConstraint.Factory.getFileMountsConstraint(resId);
List<FileMountInfo> fsDBMounts = CustomQueryUtility.queryActiveResourcesByConstraint(_dbClient, FileMountInfo.class, containmentConstraint);
if (fsDBMounts != null && !fsDBMounts.isEmpty()) {
for (FileMountInfo dbMount : fsDBMounts) {
if (dbMount.getHostId().toString().equalsIgnoreCase(hostId.toString()) && dbMount.getMountPath().equalsIgnoreCase(mountPath)) {
_log.debug("Found DB entry with mountpath {} " + mountPath);
return dbMount;
}
}
}
return null;
}
use of com.emc.storageos.db.client.constraint.ContainmentConstraint in project coprhd-controller by CoprHD.
the class UnManagedFilesystemService method queryDBFSExports.
private List<UnManagedFileExportRule> queryDBFSExports(UnManagedFileSystem fs) {
_logger.info("Querying all ExportRules Using FsId {}", fs.getId());
try {
ContainmentConstraint containmentConstraint = ContainmentConstraint.Factory.getUnManagedFileExportRulesConstraint(fs.getId());
List<UnManagedFileExportRule> fileExportRules = CustomQueryUtility.queryActiveResourcesByConstraint(_dbClient, UnManagedFileExportRule.class, containmentConstraint);
return fileExportRules;
} catch (Exception e) {
_logger.error("Error while querying {}", e);
}
return new ArrayList<UnManagedFileExportRule>();
}
use of com.emc.storageos.db.client.constraint.ContainmentConstraint in project coprhd-controller by CoprHD.
the class UnManagedFilesystemService method queryDBNfsShares.
/**
* Query DB for UnManaged FileSystem's NFS ACL
*
* @param fs
* @return List<UnManagedNFSShareACLs
*/
private List<UnManagedNFSShareACL> queryDBNfsShares(UnManagedFileSystem fs) {
_logger.info("Querying All Nfs Share ACLs Using FsId {}", fs.getId());
try {
ContainmentConstraint containmentConstraint = ContainmentConstraint.Factory.getUnManagedNfsShareAclsConstraint(fs.getId());
List<UnManagedNFSShareACL> nfsShareACLList = CustomQueryUtility.queryActiveResourcesByConstraint(_dbClient, UnManagedNFSShareACL.class, containmentConstraint);
return nfsShareACLList;
} catch (Exception e) {
_logger.error("Error while querying {}", e);
}
return new ArrayList<UnManagedNFSShareACL>();
}
use of com.emc.storageos.db.client.constraint.ContainmentConstraint in project coprhd-controller by CoprHD.
the class FileService method queryDBQuotaDirectories.
private List<QuotaDirectory> queryDBQuotaDirectories(FileShare fs) {
_log.info("Querying all quota directories Using FsId {}", fs.getId());
try {
ContainmentConstraint containmentConstraint = ContainmentConstraint.Factory.getQuotaDirectoryConstraint(fs.getId());
List<QuotaDirectory> fsQuotaDirs = CustomQueryUtility.queryActiveResourcesByConstraint(_dbClient, QuotaDirectory.class, containmentConstraint);
return fsQuotaDirs;
} catch (Exception e) {
_log.error("Error while querying {}", e);
}
return null;
}
use of com.emc.storageos.db.client.constraint.ContainmentConstraint in project coprhd-controller by CoprHD.
the class FileService method queryDBFSExports.
private List<FileExportRule> queryDBFSExports(FileShare fs) {
_log.info("Querying all ExportRules Using FsId {}", fs.getId());
try {
ContainmentConstraint containmentConstraint = ContainmentConstraint.Factory.getFileExportRulesConstraint(fs.getId());
List<FileExportRule> fileExportRules = CustomQueryUtility.queryActiveResourcesByConstraint(_dbClient, FileExportRule.class, containmentConstraint);
return fileExportRules;
} catch (Exception e) {
_log.error("Error while querying {}", e);
}
return null;
}
Aggregations