Search in sources :

Example 6 with NasCifsServer

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

the class IsilonCommunicationInterface method setCifsServerMapForNASServer.

/**
 * Set the cifs servers for accesszone
 *
 * @param isiAccessZone
 *            the Isilon access zone object
 * @param nasServer
 *            the NAS server in which CIF server map will be set
 */
private void setCifsServerMapForNASServer(final IsilonAccessZone isiAccessZone, NASServer nasServer) {
    if (nasServer == null) {
        return;
    }
    _log.info("Set the authentication providers for NAS: {}", nasServer.getNasName());
    String providerName = null;
    String domain = null;
    ArrayList<String> authArrayList = isiAccessZone.getAuth_providers();
    CifsServerMap cifsServersMap = nasServer.getCifsServersMap();
    if (cifsServersMap != null) {
        cifsServersMap.clear();
    } else {
        cifsServersMap = new CifsServerMap();
    }
    if (authArrayList != null && !authArrayList.isEmpty()) {
        for (String authProvider : authArrayList) {
            String[] providerArray = authProvider.split(":");
            providerName = providerArray[0];
            domain = providerArray[1];
            NasCifsServer nasCifsServer = new NasCifsServer();
            nasCifsServer.setName(providerName);
            nasCifsServer.setDomain(domain);
            cifsServersMap.put(providerName, nasCifsServer);
            _log.info("Setting provider: {} and domain: {}", providerName, domain);
        }
    }
    if (isiAccessZone.isAll_auth_providers() == true) {
        String[] providerArray = isiAccessZone.getSystem_provider().split(":");
        providerName = providerArray[0];
        domain = providerArray[1];
        NasCifsServer nasCifsServer = new NasCifsServer();
        nasCifsServer.setName(providerName);
        nasCifsServer.setDomain(domain);
        cifsServersMap.put(providerName, nasCifsServer);
        _log.info("Setting provider: {} and domain: {}", providerName, domain);
    }
    nasServer.setCifsServersMap(cifsServersMap);
}
Also used : CifsServerMap(com.emc.storageos.db.client.model.CifsServerMap) NasCifsServer(com.emc.storageos.db.client.model.NasCifsServer)

Aggregations

NasCifsServer (com.emc.storageos.db.client.model.NasCifsServer)6 CifsServerMap (com.emc.storageos.db.client.model.CifsServerMap)4 ArrayList (java.util.ArrayList)4 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)3 PhysicalNAS (com.emc.storageos.db.client.model.PhysicalNAS)3 StorageHADomain (com.emc.storageos.db.client.model.StorageHADomain)3 StringSet (com.emc.storageos.db.client.model.StringSet)3 URI (java.net.URI)3 HashMap (java.util.HashMap)3 List (java.util.List)3 VirtualNAS (com.emc.storageos.db.client.model.VirtualNAS)2 NamespaceList (com.emc.storageos.plugins.common.domainmodel.NamespaceList)2 VNXCifsServer (com.emc.storageos.vnx.xmlapi.VNXCifsServer)2 LinkedList (java.util.LinkedList)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 VirtualNASRestRep (com.emc.storageos.model.vnas.VirtualNASRestRep)1 VNXDataMover (com.emc.storageos.vnx.xmlapi.VNXDataMover)1 VNXFileSshApi (com.emc.storageos.vnx.xmlapi.VNXFileSshApi)1 VNXVdm (com.emc.storageos.vnx.xmlapi.VNXVdm)1 VNXeCifsServer (com.emc.storageos.vnxe.models.VNXeCifsServer)1