private Profile updateProfileInternal(Profile profile) throws BusinessException, JAXBException, IOException {
  String id=profile.getId();
  profile.setRevision(profile.getRevision() + 1);
  Profile local=existingProfiles.replace(id,profile);
  if (null == local) {
    existingProfiles.remove(id);
    throw new BusinessException("Update of the profile '" + profile.getName() + ".",ConfigurationInterfaceErrorCodeEnum.PROFILE_DOES_NOT_EXIST);
  }
 else   if ((local != profile) && ((local.getRevision() + 1) != profile.getRevision())) {
    existingProfiles.replace(id,local);
    BusinessException e=new BusinessException("Update of the profile '" + profile.getName() + ".",ConfigurationInterfaceErrorCodeEnum.REVISION_CHECK_FAILED);
    profile.setRevision(profile.getRevision() - 1);
    throw e;
  }
  profile.setUpdatedDate(new Date());
  saveProfile(profile);
  if (!Objects.equals(profile.getName(),local.getName())) {
    Files.deleteIfExists(pathResolver.getProfileFilePath(local));
  }
  publishProfileUpdateEvent(local,profile);
  return profile;
}

private Profile updateProfileInternal ( Profile profile ) throws BusinessException , JAXBException , IOException { String id = profile . getId ( ) ; profile . setRevision ( profile . getRevision ( ) + 1 ) ; Profile local = existingProfiles . replace ( id , profile ) ; if ( null == local ) { existingProfiles . remove ( id ) ; throw new BusinessException ( "Update of the profile '" + profile . getName ( ) + "." , ConfigurationInterfaceErrorCodeEnum . PROFILE_DOES_NOT_EXIST ) ; } else if ( ( local != profile ) && ( ( local . getRevision ( ) + 1 ) != profile . getRevision ( ) ) ) { existingProfiles . replace ( id , local ) ; BusinessException e = new BusinessException ( "Update of the profile '" + profile . getName ( ) + "." , ConfigurationInterfaceErrorCodeEnum . REVISION_CHECK_FAILED ) ; profile . setRevision ( profile . getRevision ( ) - 1 ) ; throw e ; } profile . setUpdatedDate ( new Date ( ) ) ; saveProfile ( profile ) ; if ( ! Objects . equals ( profile . getName ( ) , local . getName ( ) ) ) { Files . deleteIfExists ( pathResolver . getProfileFilePath ( local ) ) ; } publishProfileUpdateEvent ( local , profile ) ; return profile ; }
internal process of updating the profile .
