Search in sources :

Example 11 with UnManagedFSExport

use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport in project coprhd-controller by CoprHD.

the class NetAppFileCommunicationInterface method createExportMap.

private void createExportMap(ExportsRuleInfo export, UnManagedFSExportMap tempUnManagedExpMap, String storagePort) {
    List<ExportsHostnameInfo> readonlyHosts = export.getSecurityRuleInfos().get(0).getReadOnly();
    List<ExportsHostnameInfo> readwriteHosts = export.getSecurityRuleInfos().get(0).getReadWrite();
    List<ExportsHostnameInfo> rootHosts = export.getSecurityRuleInfos().get(0).getRoot();
    UnManagedFSExport tempUnManagedFSROExport = createUnManagedExport(export, readonlyHosts, RO, storagePort);
    if (tempUnManagedFSROExport != null) {
        tempUnManagedExpMap.put(tempUnManagedFSROExport.getFileExportKey(), tempUnManagedFSROExport);
    }
    UnManagedFSExport tempUnManagedFSRWExport = createUnManagedExport(export, readwriteHosts, RW, storagePort);
    if (tempUnManagedFSRWExport != null) {
        tempUnManagedExpMap.put(tempUnManagedFSRWExport.getFileExportKey(), tempUnManagedFSRWExport);
    }
    UnManagedFSExport tempUnManagedFSROOTExport = createUnManagedExport(export, rootHosts, ROOT, storagePort);
    if (tempUnManagedFSROOTExport != null) {
        tempUnManagedExpMap.put(tempUnManagedFSROOTExport.getFileExportKey(), tempUnManagedFSROOTExport);
    }
}
Also used : UnManagedFSExport(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport) ExportsHostnameInfo(com.iwave.ext.netapp.model.ExportsHostnameInfo)

Example 12 with UnManagedFSExport

use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport in project coprhd-controller by CoprHD.

the class PropertySetterUtil method convertUnManagedExportMapToManaged.

/**
 * extract value from a String Set
 * This method is used, to get value from a StringSet of size 1.
 *
 * @param key
 * @param volumeInformation
 * @return String
 */
public static FSExportMap convertUnManagedExportMapToManaged(UnManagedFSExportMap unManagedFSExportMap, StoragePort storagePort, StorageHADomain dataMover) {
    FSExportMap fsExportMap = new FSExportMap();
    if (unManagedFSExportMap == null) {
        return fsExportMap;
    }
    for (UnManagedFSExport export : unManagedFSExportMap.values()) {
        FileExport fsExport = new FileExport();
        if (null != export.getIsilonId()) {
            fsExport.setIsilonId(export.getIsilonId());
        }
        if (null != export.getNativeId()) {
            fsExport.setNativeId(export.getNativeId());
        }
        if (null != storagePort) {
            fsExport.setStoragePort(storagePort.getPortName());
            if ((export.getMountPath() != null) && (export.getMountPath().length() > 0)) {
                fsExport.setMountPoint(ExportUtils.getFileMountPoint(storagePort.getPortNetworkId(), export.getMountPath()));
            } else {
                fsExport.setMountPoint(ExportUtils.getFileMountPoint(storagePort.getPortNetworkId(), export.getPath()));
            }
        } else if (null != export.getStoragePort()) {
            fsExport.setStoragePort(export.getStoragePort());
            if (null != export.getMountPoint()) {
                fsExport.setMountPoint(export.getMountPoint());
            }
        }
        if (null != dataMover) {
            fsExport.setStoragePortName(dataMover.getName());
        } else if (null != storagePort) {
            fsExport.setStoragePortName(storagePort.getPortName());
        } else if (null != export.getStoragePortName()) {
            fsExport.setStoragePortName(export.getStoragePortName());
        }
        if (null != export.getMountPath()) {
            fsExport.setMountPath(export.getMountPath());
        }
        fsExport.setPath(export.getPath());
        fsExport.setPermissions(export.getPermissions());
        fsExport.setProtocol(export.getProtocol());
        fsExport.setRootUserMapping(export.getRootUserMapping());
        fsExport.setSecurityType(export.getSecurityType());
        fsExport.setClients(export.getClients());
        fsExportMap.put(fsExport.getFileExportKey(), fsExport);
    }
    return fsExportMap;
}
Also used : UnManagedFSExport(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport) FileExport(com.emc.storageos.db.client.model.FileExport) UnManagedFSExportMap(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExportMap) FSExportMap(com.emc.storageos.db.client.model.FSExportMap)

Aggregations

UnManagedFSExport (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport)12 ArrayList (java.util.ArrayList)5 ExportsHostnameInfo (com.iwave.ext.netapp.model.ExportsHostnameInfo)4 UnManagedFSExportMap (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExportMap)3 StringSet (com.emc.storageos.db.client.model.StringSet)2 DDOptionInfo (com.emc.storageos.datadomain.restapi.DDOptionInfo)1 DDExportClient (com.emc.storageos.datadomain.restapi.model.DDExportClient)1 DDExportList (com.emc.storageos.datadomain.restapi.model.DDExportList)1 DDMTreeList (com.emc.storageos.datadomain.restapi.model.DDMTreeList)1 DDNetworkList (com.emc.storageos.datadomain.restapi.model.DDNetworkList)1 DDShareList (com.emc.storageos.datadomain.restapi.model.DDShareList)1 DDSystemList (com.emc.storageos.datadomain.restapi.model.DDSystemList)1 AlternateIdConstraint (com.emc.storageos.db.client.constraint.AlternateIdConstraint)1 ContainmentConstraint (com.emc.storageos.db.client.constraint.ContainmentConstraint)1 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 FSExportMap (com.emc.storageos.db.client.model.FSExportMap)1 FileExport (com.emc.storageos.db.client.model.FileExport)1 UnManagedFileExportRule (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFileExportRule)1 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 IsilonExport (com.emc.storageos.isilon.restapi.IsilonExport)1