class FileShareMountManager {

    @Transactional(propagation = Propagation.REQUIRED)
    public FileShareMount save(final FileShareMount fileShareMount) {
        LOGGER.debug("Create new FileShareMount: " + fileShareMount);
        Assert.notNull(fileShareMount.getRegionId(), "Region id cannot be null for File share mount!");
        Assert.notNull(fileShareMount.getMountType(), "Mount type cannot be null for File share mount!");
        if (MountType.LUSTRE == fileShareMount.getMountType()) {
            Assert.isTrue(NFSHelper.isValidLustrePath(fileShareMount.getMountRoot()),
                          "Given path for the Lustre file share is invalid!");
        }
        if (fileShareMount.getId() != null && fileShareMountDao.loadById(fileShareMount.getId()).isPresent()) {
            fileShareMountDao.update(fileShareMount);
            return fileShareMount;
        }
        return fileShareMountDao.create(fileShareMount);
    }

}