protected override void OnExecute(CommandProcessor theProcessor, IUpdateContext updateContext) { // Setup the delete parameters var parms = new DeleteFilesystemStudyStorageParameters(); parms.ServerPartitionKey = _storage.ServerPartitionKey; parms.StudyStorageKey = _storage.GetKey(); parms.StudyStatusEnum = StudyStatusEnum.Nearline; // TODO: Don't we set Nearline only if all the storage location are purged? // Get the Insert Instance broker and do the insert var delete = updateContext.GetBroker <IDeleteFilesystemStudyStorage>(); if (false == delete.Execute(parms)) { Platform.Log(LogLevel.Error, "Unexpected error when trying to delete study: {0} on partition {1}", _storage.StudyInstanceUid, _storage.ServerPartition.Description); } else { // Unlock the study, too var studyLock = updateContext.GetBroker <ILockStudy>(); var lockParms = new LockStudyParameters(); lockParms.QueueStudyStateEnum = QueueStudyStateEnum.Idle; lockParms.StudyStorageKey = _storage.GetKey(); studyLock.Execute(lockParms); } }
protected override void OnExecute(CommandProcessor theProcessor, IUpdateContext updateContext) { var broker = updateContext.GetBroker <IArchiveQueueEntityBroker>(); var criteria = new ArchiveQueueSelectCriteria(); criteria.PartitionArchiveKey.EqualTo(_archive.GetKey()); criteria.StudyStorageKey.EqualTo(_studyStorage.GetKey()); broker.Delete(criteria); }
public bool IsArchivingScheduled() { using (var ctx = PersistentStoreRegistry.GetDefaultStore().OpenReadContext()) { var broker = ctx.GetBroker <IArchiveQueueEntityBroker>(); var criteria = new ArchiveQueueSelectCriteria(); criteria.StudyStorageKey.EqualTo(StudyStorage.GetKey()); return(broker.Find(criteria).Any()); } }