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);
}
Aggregations