class ExpireRestoredBusinessObjectDataHelperServiceImpl implements ExpireRestoredBusinessObjectDataHelperService {

    protected StorageUnitEntity getStorageUnit(String storageName, BusinessObjectDataEntity businessObjectDataEntity)
    {
        // Get the storage unit and make sure it exists.
        StorageUnitEntity storageUnitEntity = storageUnitDaoHelper.getStorageUnitEntity(storageName, businessObjectDataEntity);

        // Get the storage unit status.
        String storageUnitStatus = storageUnitEntity.getStatus().getCode();

        // Validate that S3 storage unit is in RESTORED state.
        if (!StorageUnitStatusEntity.RESTORED.equals(storageUnitStatus))
        {
            throw new IllegalArgumentException(String
                .format("S3 storage unit in \"%s\" storage must have \"%s\" status, but it actually has \"%s\" status. Business object data: {%s}", storageName,
                    StorageUnitStatusEntity.RESTORED, storageUnitStatus,
                    businessObjectDataHelper.businessObjectDataEntityAltKeyToString(businessObjectDataEntity)));
        }

        return storageUnitEntity;
    }

}