private List<BusinessObjectDataEntity> registerInvalidBusinessObjectDatas(BusinessObjectDataEntity latestBusinessObjectDataEntity,BusinessObjectFormatEntity businessObjectFormatEntity,List<BusinessObjectDataKey> businessObjectDataKeys,StorageEntity storageEntity){
  List<BusinessObjectDataEntity> createdBusinessObjectDataEntities=new ArrayList<>();
  if (!businessObjectDataKeys.isEmpty()) {
    if (latestBusinessObjectDataEntity != null) {
      latestBusinessObjectDataEntity.setLatestVersion(false);
    }
    BusinessObjectDataStatusEntity businessObjectDataStatusEntity=businessObjectDataStatusDao.getBusinessObjectDataStatusByCode(UNREGISTERED_STATUS);
    StorageUnitStatusEntity storageUnitStatusEntity=storageUnitStatusDao.getStorageUnitStatusByCode(StorageUnitStatusEntity.ENABLED);
    Iterator<BusinessObjectDataKey> unregisteredBusinessObjectDataKeysIterator=businessObjectDataKeys.iterator();
    while (unregisteredBusinessObjectDataKeysIterator.hasNext()) {
      BusinessObjectDataKey unregisteredBusinessObjectDataKey=unregisteredBusinessObjectDataKeysIterator.next();
      BusinessObjectDataEntity businessObjectDataEntity=new BusinessObjectDataEntity();
      businessObjectDataEntity.setBusinessObjectFormat(businessObjectFormatEntity);
      businessObjectDataEntity.setPartitionValue(unregisteredBusinessObjectDataKey.getPartitionValue());
      businessObjectDataEntity.setPartitionValue2(herdCollectionHelper.safeGet(unregisteredBusinessObjectDataKey.getSubPartitionValues(),0));
      businessObjectDataEntity.setPartitionValue3(herdCollectionHelper.safeGet(unregisteredBusinessObjectDataKey.getSubPartitionValues(),1));
      businessObjectDataEntity.setPartitionValue4(herdCollectionHelper.safeGet(unregisteredBusinessObjectDataKey.getSubPartitionValues(),2));
      businessObjectDataEntity.setPartitionValue5(herdCollectionHelper.safeGet(unregisteredBusinessObjectDataKey.getSubPartitionValues(),3));
      businessObjectDataEntity.setVersion(unregisteredBusinessObjectDataKey.getBusinessObjectDataVersion());
      List<StorageUnitEntity> storageUnitEntities=new ArrayList<>();
      StorageUnitEntity storageUnitEntity=new StorageUnitEntity();
      storageUnitEntity.setStorage(storageEntity);
      storageUnitEntity.setBusinessObjectData(businessObjectDataEntity);
      String s3KeyPrefix=s3KeyPrefixHelper.buildS3KeyPrefix(storageEntity,businessObjectFormatEntity,unregisteredBusinessObjectDataKey);
      storageUnitEntity.setDirectoryPath(s3KeyPrefix);
      storageUnitEntity.setStatus(storageUnitStatusEntity);
      storageUnitEntities.add(storageUnitEntity);
      businessObjectDataEntity.setStorageUnits(storageUnitEntities);
      businessObjectDataEntity.setStatus(businessObjectDataStatusEntity);
      businessObjectDataEntity.setLatestVersion(!unregisteredBusinessObjectDataKeysIterator.hasNext());
      businessObjectDataDao.saveAndRefresh(businessObjectDataEntity);
      createdBusinessObjectDataEntities.add(businessObjectDataEntity);
    }
  }
  return createdBusinessObjectDataEntities;
}

private List < BusinessObjectDataEntity > registerInvalidBusinessObjectDatas ( BusinessObjectDataEntity latestBusinessObjectDataEntity , BusinessObjectFormatEntity businessObjectFormatEntity , List < BusinessObjectDataKey > businessObjectDataKeys , StorageEntity storageEntity ) { List < BusinessObjectDataEntity > createdBusinessObjectDataEntities = new ArrayList < > ( ) ; if ( ! businessObjectDataKeys . isEmpty ( ) ) { if ( latestBusinessObjectDataEntity != null ) { latestBusinessObjectDataEntity . setLatestVersion ( false ) ; } BusinessObjectDataStatusEntity businessObjectDataStatusEntity = businessObjectDataStatusDao . getBusinessObjectDataStatusByCode ( UNREGISTERED_STATUS ) ; StorageUnitStatusEntity storageUnitStatusEntity = storageUnitStatusDao . getStorageUnitStatusByCode ( StorageUnitStatusEntity . ENABLED ) ; Iterator < BusinessObjectDataKey > unregisteredBusinessObjectDataKeysIterator = businessObjectDataKeys . iterator ( ) ; while ( unregisteredBusinessObjectDataKeysIterator . hasNext ( ) ) { BusinessObjectDataKey unregisteredBusinessObjectDataKey = unregisteredBusinessObjectDataKeysIterator . next ( ) ; BusinessObjectDataEntity businessObjectDataEntity = new BusinessObjectDataEntity ( ) ; businessObjectDataEntity . setBusinessObjectFormat ( businessObjectFormatEntity ) ; businessObjectDataEntity . setPartitionValue ( unregisteredBusinessObjectDataKey . getPartitionValue ( ) ) ; businessObjectDataEntity . setPartitionValue2 ( herdCollectionHelper . safeGet ( unregisteredBusinessObjectDataKey . getSubPartitionValues ( ) , 0 ) ) ; businessObjectDataEntity . setPartitionValue3 ( herdCollectionHelper . safeGet ( unregisteredBusinessObjectDataKey . getSubPartitionValues ( ) , 1 ) ) ; businessObjectDataEntity . setPartitionValue4 ( herdCollectionHelper . safeGet ( unregisteredBusinessObjectDataKey . getSubPartitionValues ( ) , 2 ) ) ; businessObjectDataEntity . setPartitionValue5 ( herdCollectionHelper . safeGet ( unregisteredBusinessObjectDataKey . getSubPartitionValues ( ) , 3 ) ) ; businessObjectDataEntity . setVersion ( unregisteredBusinessObjectDataKey . getBusinessObjectDataVersion ( ) ) ; List < StorageUnitEntity > storageUnitEntities = new ArrayList < > ( ) ; StorageUnitEntity storageUnitEntity = new StorageUnitEntity ( ) ; storageUnitEntity . setStorage ( storageEntity ) ; storageUnitEntity . setBusinessObjectData ( businessObjectDataEntity ) ; String s3KeyPrefix = s3KeyPrefixHelper . buildS3KeyPrefix ( storageEntity , businessObjectFormatEntity , unregisteredBusinessObjectDataKey ) ; storageUnitEntity . setDirectoryPath ( s3KeyPrefix ) ; storageUnitEntity . setStatus ( storageUnitStatusEntity ) ; storageUnitEntities . add ( storageUnitEntity ) ; businessObjectDataEntity . setStorageUnits ( storageUnitEntities ) ; businessObjectDataEntity . setStatus ( businessObjectDataStatusEntity ) ; businessObjectDataEntity . setLatestVersion ( ! unregisteredBusinessObjectDataKeysIterator . hasNext ( ) ) ; businessObjectDataDao . saveAndRefresh ( businessObjectDataEntity ) ; createdBusinessObjectDataEntities . add ( businessObjectDataEntity ) ; } } return createdBusinessObjectDataEntities ; }
registers a business object data specified by the given business object data keys . the registered data will have a single storage unit with a directory with the s3 key prefix of the data key . the registered data will be set to status invalid . if any registration actually occurs , the specified latestbusinessobjectdataentity latestversion will be set to false . < p / > the list of data keys must be in ordered by the data version in ascending order .
