class BusinessObjectDataStorageUnitStatusServiceImpl implements BusinessObjectDataStorageUnitStatusService {

    protected BusinessObjectDataStorageUnitStatusUpdateResponse updateBusinessObjectDataStorageUnitStatusImpl(
        BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey, BusinessObjectDataStorageUnitStatusUpdateRequest request)
    {
        // Validate and trim the business object data storage unit key.
        storageUnitHelper.validateBusinessObjectDataStorageUnitKey(businessObjectDataStorageUnitKey);

        // Validate status.
        Assert.hasText(request.getStatus(), "A business object data storage unit status must be specified.");
        request.setStatus(request.getStatus().trim());

        // Retrieve and ensure that a business object data storage unit exists with the specified key.
        StorageUnitEntity storageUnitEntity = storageUnitDaoHelper.getStorageUnitEntityByKey(businessObjectDataStorageUnitKey);

        // Retrieve and ensure the new storage unit status entity exists.
        StorageUnitStatusEntity newStorageUnitStatusEntity = storageUnitStatusDaoHelper.getStorageUnitStatusEntity(request.getStatus());

        // Save the old storage unit status value.
        String oldStorageUnitStatus = storageUnitEntity.getStatus().getCode();

        // Update the storage unit status.
        storageUnitDaoHelper.updateStorageUnitStatus(storageUnitEntity, newStorageUnitStatusEntity, request.getStatus());

        // Get business object data key from the business object data entity.
        BusinessObjectDataKey businessObjectDataKey = businessObjectDataHelper.createBusinessObjectDataKeyFromEntity(storageUnitEntity.getBusinessObjectData());

        // Create and return the business object data storage unit status response object.
        BusinessObjectDataStorageUnitStatusUpdateResponse response = new BusinessObjectDataStorageUnitStatusUpdateResponse();
        response.setBusinessObjectDataStorageUnitKey(
            storageUnitHelper.createBusinessObjectDataStorageUnitKey(businessObjectDataKey, storageUnitEntity.getStorage().getName()));
        response.setStatus(storageUnitEntity.getStatus().getCode());
        response.setPreviousStatus(oldStorageUnitStatus);

        return response;
    }

}