Search in sources :

Example 1 with SourceTargetFileSystemsFilter

use of com.emc.vipr.client.core.filters.SourceTargetFileSystemsFilter in project coprhd-controller by CoprHD.

the class FileProvider method getFileWithContinuousCopies.

@Asset("fileWithContinuousCopies")
@AssetDependencies("project")
public List<AssetOption> getFileWithContinuousCopies(AssetOptionsContext ctx, URI project) {
    final ViPRCoreClient client = api(ctx);
    List<FileShareRestRep> fileShares = client.fileSystems().findByProject(project, new SourceTargetFileSystemsFilter() {

        @Override
        public boolean acceptId(URI id) {
            return !client.fileSystems().getFileContinuousCopies(id).isEmpty();
        }
    });
    return createFilesystemOptions(fileShares);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) SourceTargetFileSystemsFilter(com.emc.vipr.client.core.filters.SourceTargetFileSystemsFilter) URI(java.net.URI) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Aggregations

Asset (com.emc.sa.asset.annotation.Asset)1 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)1 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)1 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)1 SourceTargetFileSystemsFilter (com.emc.vipr.client.core.filters.SourceTargetFileSystemsFilter)1 URI (java.net.URI)1