class UploadDownloadRestController extends HerdBaseController {

    @RequestMapping(value = "/upload/single/initiation", method = RequestMethod.POST, consumes = {"application/xml", "application/json"})
    @Secured(SecurityFunctions.FN_UPLOAD_POST)
    public UploadSingleInitiationResponse initiateUploadSingle(@RequestBody UploadSingleInitiationRequest uploadSingleInitiationRequest)
    {
        UploadSingleInitiationResponse uploadSingleInitiationResponse = uploadDownloadService.initiateUploadSingle(uploadSingleInitiationRequest);

        // Trigger notifications.
        for (BusinessObjectData businessObjectData : Arrays
            .asList(uploadSingleInitiationResponse.getSourceBusinessObjectData(), uploadSingleInitiationResponse.getTargetBusinessObjectData()))
        {
            BusinessObjectDataKey businessObjectDataKey = businessObjectDataHelper.getBusinessObjectDataKey(businessObjectData);

            // Create business object data notifications.
            for (NotificationEventTypeEntity.EventTypesBdata eventType : Arrays
                .asList(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG))
            {
                notificationEventService
                    .processBusinessObjectDataNotificationEventAsync(eventType, businessObjectDataKey, businessObjectData.getStatus(), null);
            }

            // Create storage unit notifications.
            for (StorageUnit storageUnit : businessObjectData.getStorageUnits())
            {
                notificationEventService
                    .processStorageUnitNotificationEventAsync(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG, businessObjectDataKey,
                        storageUnit.getStorage().getName(), storageUnit.getStorageUnitStatus(), null);
            }
        }

        return uploadSingleInitiationResponse;
    }

}