use of com.emc.storageos.model.file.UnManagedFileSystemRestRep in project coprhd-controller by CoprHD.
the class FileMapper method map.
public static UnManagedFileSystemRestRep map(UnManagedFileSystem from) {
if (from == null) {
return null;
}
UnManagedFileSystemRestRep to = new UnManagedFileSystemRestRep();
mapDataObjectFields(from, to);
to.setNativeGuid(from.getNativeGuid());
try {
to.setFileSystemInformation(new StringSetMapAdapter().marshal(from.getFileSystemInformation()));
} catch (Exception e) {
_log.error("Exception while setting FileSystem information ", e);
}
to.setFileSystemCharacteristics(new StringMapAdapter().marshal(from.getFileSystemCharacterstics()));
to.setStorageSystem(toRelatedResource(ResourceTypeEnum.STORAGE_SYSTEM, from.getStorageSystemUri()));
to.setStoragePool(toRelatedResource(ResourceTypeEnum.STORAGE_POOL, from.getStoragePoolUri()));
if (null != from.getSupportedVpoolUris() && !from.getSupportedVpoolUris().isEmpty()) {
List<String> supportedVPoolList = new ArrayList<String>(from.getSupportedVpoolUris());
to.setSupportedVPoolUris(supportedVPoolList);
}
return to;
}
use of com.emc.storageos.model.file.UnManagedFileSystemRestRep in project coprhd-controller by CoprHD.
the class VirtualDataCenterProvider method getFileVirtualPools.
protected static Map<URI, Integer> getFileVirtualPools(List<UnManagedFileSystemRestRep> fileSystems, String exportType) {
Map<URI, Integer> map = Maps.newLinkedHashMap();
String isExportedSelected = FALSE_STR;
if (exportType != null) {
isExportedSelected = exportType.equalsIgnoreCase(ExportType.EXPORTED.name()) ? TRUE_STR : FALSE_STR;
}
for (UnManagedFileSystemRestRep fileSystem : fileSystems) {
Set<URI> vpools = getVpoolsForUnmanaged(fileSystem.getFileSystemCharacteristics(), fileSystem.getSupportedVPoolUris(), isExportedSelected);
for (URI vpool : vpools) {
if (map.containsKey(vpool)) {
map.put(vpool, map.get(vpool).intValue() + 1);
} else {
map.put(vpool, 1);
}
}
}
return map;
}
use of com.emc.storageos.model.file.UnManagedFileSystemRestRep in project coprhd-controller by CoprHD.
the class IngestUnmanagedFilesystemsService method execute.
@Override
public void execute() throws Exception {
List<UnManagedFileSystemRestRep> unmanaged = execute(new GetUnmanagedFilesystems(storageSystem, virtualPool, type));
List<URI> filesystems = Lists.newArrayList();
for (UnManagedFileSystemRestRep fileSystem : unmanaged) {
filesystems.add(fileSystem.getId());
}
execute(new IngestUnmanagedFilesystems(virtualPool, virtualArray, project, filesystems));
// Requery and produce a log of what was ingested or not
int failed = execute(new GetUnmanagedFilesystems(storageSystem, virtualPool, type)).size();
logInfo("ingest.unmanaged.filesystems.service.ingested", unmanaged.size() - failed);
logInfo("ingest.unmanaged.filesystems.service.skipped", failed);
}
Aggregations