Esempio n. 1
0
 public WorkQueueTypeProperties(
      WorkQueueTypeEnum _workQueueTypeEnum_
     ,WorkQueuePriorityEnum _workQueuePriorityEnum_
     ,Boolean _memoryLimited_
     ,Boolean _alertFailedWorkQueue_
     ,Int32 _maxFailureCount_
     ,Int32 _processDelaySeconds_
     ,Int32 _failureDelaySeconds_
     ,Int32 _deleteDelaySeconds_
     ,Int32 _postponeDelaySeconds_
     ,Int32 _expireDelaySeconds_
     ,Int32 _maxBatchSize_
     ,Boolean _readLock_
     ,Boolean _writeLock_
     ,QueueStudyStateEnum _queueStudyStateEnum_
     ,Int16 _queueStudyStateOrder_
     ):base("WorkQueueTypeProperties")
 {
     WorkQueueTypeEnum = _workQueueTypeEnum_;
     WorkQueuePriorityEnum = _workQueuePriorityEnum_;
     MemoryLimited = _memoryLimited_;
     AlertFailedWorkQueue = _alertFailedWorkQueue_;
     MaxFailureCount = _maxFailureCount_;
     ProcessDelaySeconds = _processDelaySeconds_;
     FailureDelaySeconds = _failureDelaySeconds_;
     DeleteDelaySeconds = _deleteDelaySeconds_;
     PostponeDelaySeconds = _postponeDelaySeconds_;
     ExpireDelaySeconds = _expireDelaySeconds_;
     MaxBatchSize = _maxBatchSize_;
     ReadLock = _readLock_;
     WriteLock = _writeLock_;
     QueueStudyStateEnum = _queueStudyStateEnum_;
     QueueStudyStateOrder = _queueStudyStateOrder_;
 }
 public WorkQueueTypeProperties(
     WorkQueueTypeEnum _workQueueTypeEnum_
     , WorkQueuePriorityEnum _workQueuePriorityEnum_
     , Boolean _memoryLimited_
     , Boolean _alertFailedWorkQueue_
     , Int32 _maxFailureCount_
     , Int32 _processDelaySeconds_
     , Int32 _failureDelaySeconds_
     , Int32 _deleteDelaySeconds_
     , Int32 _postponeDelaySeconds_
     , Int32 _expireDelaySeconds_
     , Int32 _maxBatchSize_
     , Boolean _readLock_
     , Boolean _writeLock_
     , QueueStudyStateEnum _queueStudyStateEnum_
     , Int16 _queueStudyStateOrder_
     ) : base("WorkQueueTypeProperties")
 {
     WorkQueueTypeEnum     = _workQueueTypeEnum_;
     WorkQueuePriorityEnum = _workQueuePriorityEnum_;
     MemoryLimited         = _memoryLimited_;
     AlertFailedWorkQueue  = _alertFailedWorkQueue_;
     MaxFailureCount       = _maxFailureCount_;
     ProcessDelaySeconds   = _processDelaySeconds_;
     FailureDelaySeconds   = _failureDelaySeconds_;
     DeleteDelaySeconds    = _deleteDelaySeconds_;
     PostponeDelaySeconds  = _postponeDelaySeconds_;
     ExpireDelaySeconds    = _expireDelaySeconds_;
     MaxBatchSize          = _maxBatchSize_;
     ReadLock             = _readLock_;
     WriteLock            = _writeLock_;
     QueueStudyStateEnum  = _queueStudyStateEnum_;
     QueueStudyStateOrder = _queueStudyStateOrder_;
 }
Esempio n. 3
0
 public StudyStorage(
      ServerEntityKey _serverPartitionKey_
     ,String _studyInstanceUid_
     ,DateTime _insertTime_
     ,DateTime _lastAccessedTime_
     ,Boolean _writeLock_
     ,Int16 _readLock_
     ,StudyStatusEnum _studyStatusEnum_
     ,QueueStudyStateEnum _queueStudyStateEnum_
     ):base("StudyStorage")
 {
     ServerPartitionKey = _serverPartitionKey_;
     StudyInstanceUid = _studyInstanceUid_;
     InsertTime = _insertTime_;
     LastAccessedTime = _lastAccessedTime_;
     WriteLock = _writeLock_;
     ReadLock = _readLock_;
     StudyStatusEnum = _studyStatusEnum_;
     QueueStudyStateEnum = _queueStudyStateEnum_;
 }
Esempio n. 4
0
 public StudyStorage(
     ServerEntityKey _serverPartitionKey_
     , String _studyInstanceUid_
     , DateTime _insertTime_
     , DateTime _lastAccessedTime_
     , Boolean _writeLock_
     , Int16 _readLock_
     , StudyStatusEnum _studyStatusEnum_
     , QueueStudyStateEnum _queueStudyStateEnum_
     ) : base("StudyStorage")
 {
     ServerPartitionKey  = _serverPartitionKey_;
     StudyInstanceUid    = _studyInstanceUid_;
     InsertTime          = _insertTime_;
     LastAccessedTime    = _lastAccessedTime_;
     WriteLock           = _writeLock_;
     ReadLock            = _readLock_;
     StudyStatusEnum     = _studyStatusEnum_;
     QueueStudyStateEnum = _queueStudyStateEnum_;
 }
Esempio n. 5
0
		public LockStudyCommand(ServerEntityKey studyStorageKey, QueueStudyStateEnum studyState) : base("LockStudy")
		{
			_studyStorageKey = studyStorageKey;
			_queueStudyState = studyState;
		}
Esempio n. 6
0
 public StudyAccessException(String message, QueueStudyStateEnum state, Exception innerException)
     : base(message, innerException)
 {
     _studyState = state;
 }
Esempio n. 7
0
        /// <summary>
        /// Sets the Queue Study State of the study.
        /// </summary>
        /// <param name="studyStorageKey">The <see cref="ServerEntityKey"/> of the <see cref="StudyStorage"/> record.</param>
        /// <param name="state">The state of the study to set</param>
        /// <param name="failureReason">A string value describing why the state could not be set.</param>
        /// <returns>True if the state of the study was successfully set. False otherwise.</returns>
        public static bool LockStudy(ServerEntityKey studyStorageKey, QueueStudyStateEnum state, out string failureReason)
        {
            using (IUpdateContext updateContext = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush))
            {
                ILockStudy lockStudyBroker = updateContext.GetBroker<ILockStudy>();
                LockStudyParameters lockStudyParams = new LockStudyParameters
                                                      	{
                                                      		StudyStorageKey = studyStorageKey,
                                                      		QueueStudyStateEnum = state
                                                      	};

            	if (!lockStudyBroker.Execute(lockStudyParams) || !lockStudyParams.Successful)
                {
                    failureReason = lockStudyParams.FailureReason;
                    return false;
                }
            	updateContext.Commit();
            	failureReason = null;
            	return true;
            }
        }