use of com.emc.nas.vnxfile.xmlapi.NfsOptions in project coprhd-controller by CoprHD.
the class VNXFileArgsCreator method mountFileSystem.
public InputStream mountFileSystem(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
_logger.info("Mounting VNX File System");
InputStream iStream = null;
try {
Task task = new Task();
NewMount mount = new NewMount();
String path = (String) keyMap.get(VNXFileConstants.MOUNT_PATH);
String id = (String) keyMap.get(VNXFileConstants.FILESYSTEM_ID);
String isVirtual = (String) keyMap.get(VNXFileConstants.ISVDM);
Set<String> moverIds = (Set<String>) keyMap.get(VNXFileConstants.MOVERLIST);
if (isInValid(path) || isInValid(id) || null == moverIds || (moverIds.isEmpty())) {
throw new VNXFilePluginException("Prior command did not execute successfully", VNXFilePluginException.ERRORCODE_ILLEGALARGUMENTEXCEPTION);
}
if (moverIds.isEmpty()) {
throw new VNXFilePluginException("No movers found to mount", new Exception());
}
String[] movers = moverIds.toArray(new String[0]);
_logger.info("Mount file system id: {} and isVirtual {}", id, isVirtual);
_logger.info("Mount file system path: {}, Mover: {} ", path, movers[0]);
Boolean moverType = new Boolean(isVirtual);
MoverOrVdmRef mov = new MoverOrVdmRef();
mov.setMover(movers[0]);
mov.setMoverIdIsVdm(moverType);
NfsOptions nfs = new NfsOptions();
nfs.setPrefetch(false);
nfs.setRo(false);
nfs.setUncached(true);
nfs.setVirusScan(false);
CifsOptions cif = new CifsOptions();
cif.setAccessPolicy(AccessPolicy.NATIVE);
cif.setCifsSyncwrite(true);
cif.setLockingPolicy(LockingPolicy.NOLOCK);
cif.setNotify(true);
cif.setNotifyOnAccess(true);
cif.setOplock(true);
cif.setTriggerLevel(128);
cif.setNotifyOnWrite(true);
mount.setMoverOrVdm(mov);
mount.setPath(path);
mount.setFileSystem(id);
mount.setNfsOptions(nfs);
mount.setCifsOptions(cif);
task.setNewMount(mount);
iStream = _vnxFileInputRequestBuilder.getTaskParamPacket(task);
} catch (JAXBException jaxbException) {
throw new VNXFilePluginException("Exception occurred while generating input xml for unmount file system", jaxbException.getCause());
}
return iStream;
}
Aggregations