Class DmpConsistencyUtility

java.lang.Object
org.damap.base.rest.dmp.service.DmpConsistencyUtility

public class DmpConsistencyUtility extends Object
DmpConsistencyUtility class.
  • Constructor Details

    • DmpConsistencyUtility

      public DmpConsistencyUtility()
  • Method Details

    • enforceDmpConsistency

      public void enforceDmpConsistency(DmpDO dmpDO)
      Adapts a given DMP so that it's information is consistent.
      Parameters:
      dmpDO - the DMP to check and adapt.
    • enforceActiveStorage

      public void enforceActiveStorage(DmpDO newDmp, Dmp oldDmp, InternalStorageService internalStorageService) throws jakarta.validation.ValidationException
      Validates that all internal storage used in the new DMP are active. If there is no old DMP, it retrieves the storage IDs from the new DMP and checks their active status using the InternalStorageService. If comparing with an old DMP, the method checks any new storage IDs added in the new DMP and ensures they are active. If any storage is inactive, a ValidationException is thrown. A storage that is already in the old DMP is not checked for active status.
      Parameters:
      newDmp - the new DMP
      oldDmp - the old DMP
      internalStorageService - the internal storage service
      Throws:
      jakarta.validation.ValidationException - if at least one storage is not active