/// <summary>
 /// Creates an instance of <see cref="RestoreProcessorContext"/>
 /// </summary>
 /// <param name="item"></param>
 public RestoreProcessorContext(RestoreQueue item)
     :base(item.GetKey().Key.ToString())
 {
     Platform.CheckForNullReference(item, "item");
     _item = item;
 }
		/// <summary>
		/// Update a <see cref="RestoreQueue"/> entry.
		/// </summary>
		/// <param name="item">The item to update.</param>
		/// <param name="status">The status to set the entry to.</param>
		/// <param name="scheduledTime">The scheduled time to set the entry to.</param>
		/// <param name="updateContext">The update context</param>
		public bool UpdateRestoreQueue(IUpdateContext updateContext, RestoreQueue item, RestoreQueueStatusEnum status, DateTime scheduledTime)
		{
			UpdateRestoreQueueParameters parms = new UpdateRestoreQueueParameters();
			parms.RestoreQueueKey = item.GetKey();
			parms.RestoreQueueStatusEnum = status;
			parms.ScheduledTime = scheduledTime;
			parms.StudyStorageKey = item.StudyStorageKey;
			if (!String.IsNullOrEmpty(item.FailureDescription))
				parms.FailureDescription = item.FailureDescription;
				
			IUpdateRestoreQueue broker = updateContext.GetBroker<IUpdateRestoreQueue>();

			if (broker.Execute(parms))
			{
				return true;
			}
			
			Platform.Log(LogLevel.Error, "Unexpected failure updating RestoreQueue entry {0}", item.GetKey());
			return false;
		}