Esempio n. 1
0
 public RestoreQueue(
     ServerEntityKey _archiveStudyStorageKey_
     , ServerEntityKey _studyStorageKey_
     , DateTime _scheduledTime_
     , RestoreQueueStatusEnum _restoreQueueStatusEnum_
     , String _processorId_
     , String _failureDescription_
     ) : base("RestoreQueue")
 {
     ArchiveStudyStorageKey = _archiveStudyStorageKey_;
     StudyStorageKey        = _studyStorageKey_;
     ScheduledTime          = _scheduledTime_;
     RestoreQueueStatusEnum = _restoreQueueStatusEnum_;
     ProcessorId            = _processorId_;
     FailureDescription     = _failureDescription_;
 }
Esempio n. 2
0
 public RestoreQueue(
      ServerEntityKey _archiveStudyStorageKey_
     ,ServerEntityKey _studyStorageKey_
     ,DateTime _scheduledTime_
     ,RestoreQueueStatusEnum _restoreQueueStatusEnum_
     ,String _processorId_
     ,String _failureDescription_
     ):base("RestoreQueue")
 {
     ArchiveStudyStorageKey = _archiveStudyStorageKey_;
     StudyStorageKey = _studyStorageKey_;
     ScheduledTime = _scheduledTime_;
     RestoreQueueStatusEnum = _restoreQueueStatusEnum_;
     ProcessorId = _processorId_;
     FailureDescription = _failureDescription_;
 }
		/// <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;
		}
		/// <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>
		public void UpdateRestoreQueue(RestoreQueue item, RestoreQueueStatusEnum status, DateTime scheduledTime)
		{
			using (IUpdateContext updateContext = PersistentStore.OpenUpdateContext(UpdateContextSyncMode.Flush))
			{
				if (UpdateRestoreQueue(updateContext, item, status, scheduledTime))
					updateContext.Commit();
			}
		}