Search in sources :

Example 1 with UnManagedFileSystemRestRep

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;
}
Also used : StringSetMapAdapter(com.emc.storageos.model.adapters.StringSetMapAdapter) UnManagedFileSystemRestRep(com.emc.storageos.model.file.UnManagedFileSystemRestRep) ArrayList(java.util.ArrayList) StringMapAdapter(com.emc.storageos.model.adapters.StringMapAdapter)

Example 2 with UnManagedFileSystemRestRep

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;
}
Also used : UnManagedFileSystemRestRep(com.emc.storageos.model.file.UnManagedFileSystemRestRep) URI(java.net.URI)

Example 3 with UnManagedFileSystemRestRep

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);
}
Also used : UnManagedFileSystemRestRep(com.emc.storageos.model.file.UnManagedFileSystemRestRep) GetUnmanagedFilesystems(com.emc.sa.service.vipr.file.tasks.GetUnmanagedFilesystems) IngestUnmanagedFilesystems(com.emc.sa.service.vipr.file.tasks.IngestUnmanagedFilesystems) URI(java.net.URI)

Aggregations

UnManagedFileSystemRestRep (com.emc.storageos.model.file.UnManagedFileSystemRestRep)3 URI (java.net.URI)2 GetUnmanagedFilesystems (com.emc.sa.service.vipr.file.tasks.GetUnmanagedFilesystems)1 IngestUnmanagedFilesystems (com.emc.sa.service.vipr.file.tasks.IngestUnmanagedFilesystems)1 StringMapAdapter (com.emc.storageos.model.adapters.StringMapAdapter)1 StringSetMapAdapter (com.emc.storageos.model.adapters.StringSetMapAdapter)1 ArrayList (java.util.ArrayList)1