use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getFilePolicies.
@Asset("fileFilePolicy")
@AssetDependencies({ "project", "fileFilesystemAssociation" })
public List<AssetOption> getFilePolicies(AssetOptionsContext ctx, URI project, URI fsId) {
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
for (FilePolicyRestRep policyRestRep : getAllFileSystemLevelPolicies(ctx)) {
options.add(new AssetOption(policyRestRep.getId(), policyRestRep.getName()));
}
if (options != null && !options.isEmpty()) {
AssetOptionsUtils.sortOptionsByLabel(options);
}
return options;
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getFileFilesystemSourceArrayForAssociation.
@Asset("fileFilesystemSourceArray")
@AssetDependencies("fileFilesystemAssociation")
public List<AssetOption> getFileFilesystemSourceArrayForAssociation(AssetOptionsContext ctx, URI fsId) {
ViPRCoreClient client = api(ctx);
VirtualArrayRestRep vArray = null;
List<AssetOption> options = Lists.newArrayList();
FileShareRestRep fsObj = client.fileSystems().get(fsId);
if (fsObj != null) {
vArray = client.varrays().get(fsObj.getVirtualArray().getId());
options.add(createBaseResourceOption(vArray));
}
return options;
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getExportedSubdirectory.
@Asset("subDirectory")
@AssetDependencies("fileExportedFilesystem")
public List<AssetOption> getExportedSubdirectory(AssetOptionsContext ctx, URI fileExportedFilesystem) {
List<AssetOption> options = Lists.newArrayList();
List<ExportRule> exports = api(ctx).fileSystems().getExport(fileExportedFilesystem, true, null);
for (ExportRule export : exports) {
AssetOption tempOption;
if (StringUtils.isEmpty(getSubDir(ctx, export))) {
tempOption = new AssetOption("!No subdirectory", "No subdirectory");
} else {
tempOption = new AssetOption(getSubDir(ctx, export), getSubDir(ctx, export));
}
if (!options.contains(tempOption)) {
options.add(tempOption);
}
}
AssetOptionsUtils.sortOptionsByKey(options);
return options;
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getFileExports.
@Asset("fileExports")
@AssetDependencies("fileFilesystem")
public List<AssetOption> getFileExports(AssetOptionsContext ctx, URI fileFilesystem) {
List<AssetOption> options = Lists.newArrayList();
for (FileSystemExportParam export : listFileExports(ctx, fileFilesystem)) {
options.add(new AssetOption(export.getMountPoint(), export.getMountPoint()));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getExportedFilesystems.
// For mount operation
@Asset("fileExportedFilesystem")
@AssetDependencies("project")
public List<AssetOption> getExportedFilesystems(AssetOptionsContext ctx, URI project) {
List<FileShareRestRep> filesystems = api(ctx).fileSystems().findByProject(project);
List<FileShareRestRep> exportedFS = new ArrayList<FileShareRestRep>();
for (FileShareRestRep fs : filesystems) {
if (!api(ctx).fileSystems().getExports(fs.getId()).isEmpty()) {
exportedFS.add(fs);
}
}
return createFilesystemOptions(exportedFS, null);
}
Aggregations