private void updateNFSACLsInDB(NfsACLUpdateParams param,FileShare fs,FileDeviceInputOutput args){
  try {
    List<NfsACE> aceAdd=param.getAcesToAdd();
    if (aceAdd != null && !aceAdd.isEmpty()) {
      for (      NfsACE ace : aceAdd) {
        NFSShareACL dbNfsAcl=new NFSShareACL();
        dbNfsAcl.setId(URIUtil.createId(NFSShareACL.class));
        copyToPersistNfsACL(ace,dbNfsAcl,fs,args);
        _log.info("Storing new acl in DB: {}",dbNfsAcl);
        _dbClient.createObject(dbNfsAcl);
      }
    }
    List<NfsACE> aceModify=param.getAcesToModify();
    if (aceModify != null && !aceModify.isEmpty()) {
      for (      NfsACE ace : aceModify) {
        NFSShareACL dbNfsAcl=new NFSShareACL();
        copyToPersistNfsACL(ace,dbNfsAcl,fs,args);
        NFSShareACL dbNfsAclTemp=getExistingNfsAclFromDB(dbNfsAcl,args.getFileOperation());
        if (dbNfsAclTemp != null) {
          dbNfsAcl.setId(dbNfsAclTemp.getId());
          _log.info("Modifying acl in DB: {}",dbNfsAcl);
          _dbClient.updateObject(dbNfsAcl);
        }
      }
    }
    List<NfsACE> aceDelete=param.getAcesToDelete();
    if (aceDelete != null && !aceDelete.isEmpty()) {
      for (      NfsACE ace : aceDelete) {
        NFSShareACL dbNfsAcl=new NFSShareACL();
        copyToPersistNfsACL(ace,dbNfsAcl,fs,args);
        NFSShareACL dbNfsAclTemp=getExistingNfsAclFromDB(dbNfsAcl,args.getFileOperation());
        if (dbNfsAclTemp != null) {
          dbNfsAcl.setId(dbNfsAclTemp.getId());
          dbNfsAcl.setInactive(true);
          _log.info("Marking acl inactive in DB: {}",dbNfsAcl);
          _dbClient.updateObject(dbNfsAcl);
        }
      }
    }
  }
 catch (  Exception e) {
    _log.error("Error While executing CRUD Operations {}",e);
  }
}

private void updateNFSACLsInDB ( NfsACLUpdateParams param , FileShare fs , FileDeviceInputOutput args ) { try { List < NfsACE > aceAdd = param . getAcesToAdd ( ) ; if ( aceAdd != null && ! aceAdd . isEmpty ( ) ) { for ( NfsACE ace : aceAdd ) { NFSShareACL dbNfsAcl = new NFSShareACL ( ) ; dbNfsAcl . setId ( URIUtil . createId ( NFSShareACL . class ) ) ; copyToPersistNfsACL ( ace , dbNfsAcl , fs , args ) ; _log . info ( "Storing new acl in DB: {}" , dbNfsAcl ) ; _dbClient . createObject ( dbNfsAcl ) ; } } List < NfsACE > aceModify = param . getAcesToModify ( ) ; if ( aceModify != null && ! aceModify . isEmpty ( ) ) { for ( NfsACE ace : aceModify ) { NFSShareACL dbNfsAcl = new NFSShareACL ( ) ; copyToPersistNfsACL ( ace , dbNfsAcl , fs , args ) ; NFSShareACL dbNfsAclTemp = getExistingNfsAclFromDB ( dbNfsAcl , args . getFileOperation ( ) ) ; if ( dbNfsAclTemp != null ) { dbNfsAcl . setId ( dbNfsAclTemp . getId ( ) ) ; _log . info ( "Modifying acl in DB: {}" , dbNfsAcl ) ; _dbClient . updateObject ( dbNfsAcl ) ; } } } List < NfsACE > aceDelete = param . getAcesToDelete ( ) ; if ( aceDelete != null && ! aceDelete . isEmpty ( ) ) { for ( NfsACE ace : aceDelete ) { NFSShareACL dbNfsAcl = new NFSShareACL ( ) ; copyToPersistNfsACL ( ace , dbNfsAcl , fs , args ) ; NFSShareACL dbNfsAclTemp = getExistingNfsAclFromDB ( dbNfsAcl , args . getFileOperation ( ) ) ; if ( dbNfsAclTemp != null ) { dbNfsAcl . setId ( dbNfsAclTemp . getId ( ) ) ; dbNfsAcl . setInactive ( true ) ; _log . info ( "Marking acl inactive in DB: {}" , dbNfsAcl ) ; _dbClient . updateObject ( dbNfsAcl ) ; } } } } catch ( Exception e ) { _log . error ( "Error While executing CRUD Operations {}" , e ) ; } }
update the db object , this method need to be called after the success of back end command
