use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport in project coprhd-controller by CoprHD.
the class NetAppFileCommunicationInterface method createUnManagedExport.
private UnManagedFSExport createUnManagedExport(ExportsRuleInfo export, List<ExportsHostnameInfo> typeHosts, String permission, String port) {
List<String> clientList = new ArrayList<String>();
UnManagedFSExport tempUnManagedFSExport = null;
if ((null != typeHosts) && !typeHosts.isEmpty()) {
for (ExportsHostnameInfo client : typeHosts) {
if ((null != client.getName() && !(clientList.contains(client.getName())))) {
if (!clientList.contains(client.getName())) {
clientList.add(client.getName());
}
} else if ((null != client.getAllHosts()) && (client.getAllHosts())) {
// All hosts means empty clientList in ViPR.
clientList.clear();
_logger.info("Settng ClientList to empty as the export is meant to be accsible to all hosts");
}
}
String anon = export.getSecurityRuleInfos().get(0).getAnon();
if ((null != anon) && (anon.equals(ROOT_UID))) {
anon = ROOT_USER_ACCESS;
} else {
anon = DEFAULT_ANONMOUS_ACCESS;
}
tempUnManagedFSExport = new UnManagedFSExport(clientList, port, port + ":" + export.getPathname(), export.getSecurityRuleInfos().get(0).getSecFlavor(), permission, anon, NFS, port, export.getPathname(), export.getPathname());
}
return tempUnManagedFSExport;
}
use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport in project coprhd-controller by CoprHD.
the class DataDomainCommunicationInterface method createExportMap.
private void createExportMap(DDExportInfoDetail export, UnManagedFileSystem unManagedFS, List<StoragePort> ports) {
Map<String, List<String>> endPointMap = new HashMap<String, List<String>>();
for (DDExportClient client : export.getClients()) {
List<String> clients = endPointMap.get(client.getOptions());
if (clients == null) {
clients = new ArrayList<String>();
endPointMap.put(client.getOptions(), clients);
}
clients.add(client.getName());
}
UnManagedFSExportMap exportMap = unManagedFS.getFsUnManagedExportMap();
if (exportMap == null) {
exportMap = new UnManagedFSExportMap();
unManagedFS.setFsUnManagedExportMap(exportMap);
}
Set<String> options = endPointMap.keySet();
for (String option : options) {
UnManagedFSExport fExport = new UnManagedFSExport();
fExport.setNativeId(export.getId());
fExport.setMountPath(export.getPath());
fExport.setMountPoint(export.getPath());
fExport.setPath(export.getPath());
fExport.setClients(endPointMap.get(option));
DDOptionInfo optionInfo = DDOptionInfo.parseOptions(option);
fExport.setPermissions(optionInfo.permission);
fExport.setProtocol(NFS);
fExport.setRootUserMapping(optionInfo.rootMapping);
fExport.setSecurityType(optionInfo.security);
// need to find the port which was used to create this export.
// Right now DD API does not contain any info on that.
Collections.shuffle(ports);
fExport.setStoragePort(ports.get(0).getId().toString());
fExport.setStoragePortName(ports.get(0).getPortName());
String exportKey = fExport.getFileExportKey();
exportMap.put(exportKey, fExport);
}
}
use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport in project coprhd-controller by CoprHD.
the class VNXFileCommunicationInterface method createUnManagedExportWithAccessHosts.
private UnManagedFSExport createUnManagedExportWithAccessHosts(List<String> accessHosts, List<String> rwHosts, String mountPath, String security, StoragePort storagePort, String anonUser, String protocol) {
UnManagedFSExport unManagedfileExport = new UnManagedFSExport();
setupUnManagedFSExportProperties(unManagedfileExport, mountPath, security, storagePort, anonUser, protocol);
unManagedfileExport.setClients(accessHosts);
if (rwHosts == null) {
unManagedfileExport.setPermissions(VNXFileConstants.RW);
} else {
unManagedfileExport.setPermissions(VNXFileConstants.RO);
}
return unManagedfileExport;
}
use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport in project coprhd-controller by CoprHD.
the class VNXFileCommunicationInterface method createUnManagedExportWithRoHosts.
private UnManagedFSExport createUnManagedExportWithRoHosts(List<String> roHosts, List<String> accessHosts, String mountPath, String security, StoragePort storagePort, String anonUser, String protocol) {
UnManagedFSExport unManagedfileExport = new UnManagedFSExport();
setupUnManagedFSExportProperties(unManagedfileExport, mountPath, security, storagePort, anonUser, protocol);
List<String> readOnlyHosts = roHosts;
if (accessHosts != null) {
for (String accHost : accessHosts) {
if (!(readOnlyHosts.contains(accHost))) {
readOnlyHosts.add(accHost);
}
}
}
unManagedfileExport.setClients(readOnlyHosts);
unManagedfileExport.setPermissions(VNXFileConstants.RO);
return unManagedfileExport;
}
use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExport in project coprhd-controller by CoprHD.
the class NetAppClusterModeCommIntf method createUnManagedExport.
private UnManagedFSExport createUnManagedExport(ExportsRuleInfo export, List<ExportsHostnameInfo> typeHosts, String permission, String port) {
List<String> clientList = new ArrayList<String>();
UnManagedFSExport tempUnManagedFSExport = null;
if ((null != typeHosts) && (!typeHosts.isEmpty())) {
for (ExportsHostnameInfo client : typeHosts) {
boolean negate = false;
if (client.getNegate() != null) {
negate = client.getNegate();
}
if (!negate) {
if ((null != client.getName() && !(clientList.contains(client.getName())))) {
if (!clientList.contains(client.getName())) {
clientList.add(client.getName());
}
} else if ((null != client.getAllHosts()) && (client.getAllHosts())) {
// All hosts means empty clientList in ViPR.
clientList.clear();
_logger.info("Settng ClientList to empty as the export is meant to be accsible to all hosts");
}
}
}
String anon = export.getSecurityRuleInfos().get(0).getAnon();
if ((null != anon) && (anon.equals(ROOT_UID))) {
anon = ROOT_USER_ACCESS;
} else {
anon = DEFAULT_ANONMOUS_ACCESS;
}
tempUnManagedFSExport = new UnManagedFSExport(clientList, port, port + ":" + export.getPathname(), export.getSecurityRuleInfos().get(0).getSecFlavor(), permission, anon, NFS, port, export.getPathname(), export.getPathname());
}
return tempUnManagedFSExport;
}
Aggregations