本文整理汇总了C#中ClearCanvas.ImageServer.Model.ServerPartition类的典型用法代码示例。如果您正苦于以下问题:C# ServerPartition类的具体用法?C# ServerPartition怎么用?C# ServerPartition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerPartition类属于ClearCanvas.ImageServer.Model命名空间,在下文中一共展示了ServerPartition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveSeries
/// <summary>
/// Inserts a move request to move one or more series in a study.
/// </summary>
/// <param name="context">The persistence context used for database connection.</param>
/// <param name="partition">The <see cref="ServerPartition"/> where the study resides</param>
/// <param name="studyInstanceUid">The Study Instance Uid of the study</param>
/// <param name="deviceKey">The Key of the device to move the series to.</param>
/// <param name="seriesInstanceUids">The Series Instance Uid of the series to be move.</param>
/// <param name="externalRequest">Optional <see cref="ExternalRequestQueue"/> entry that triggered this move</param>
/// <returns>A MoveSeries <see cref="WorkQueue"/> entry inserted into the system.</returns>
/// <exception cref="InvalidStudyStateOperationException"></exception>
public static IList<WorkQueue> MoveSeries(IUpdateContext context, ServerPartition partition, string studyInstanceUid, ServerEntityKey deviceKey, List<string> seriesInstanceUids, ExternalRequestQueue externalRequest=null)
{
// Find all location of the study in the system and insert series delete request
IList<StudyStorageLocation> storageLocations = StudyStorageLocation.FindStorageLocations(partition.Key, studyInstanceUid);
IList<WorkQueue> entries = new List<WorkQueue>();
foreach (StudyStorageLocation location in storageLocations)
{
try
{
// insert a move series request
WorkQueue request = InsertMoveSeriesRequest(context, location, seriesInstanceUids, deviceKey, externalRequest);
Debug.Assert(request.WorkQueueTypeEnum.Equals(WorkQueueTypeEnum.WebMoveStudy));
entries.Add(request);
}
catch (Exception ex)
{
Platform.Log(LogLevel.Error, ex, "Errors occurred when trying to insert move request");
if (!ServerHelper.UnlockStudy(location.Key))
throw new ApplicationException("Unable to unlock the study");
}
}
return entries;
}
示例2: LoadPartitionSopClasses
private IEnumerable<PartitionSopClass> LoadPartitionSopClasses(ServerPartition partition)
{
IList<PartitionSopClass> list = null;
if (Cache.IsSupported())
{
var cacheKey = "PartitionSopClasses-" + partition.Key;
using (var cacheClient = Cache.CreateClient(_cacheId))
{
list = cacheClient.Get(cacheKey, new CacheGetOptions("default")) as IList<PartitionSopClass>;
if (list == null)
{
Platform.Log(LogLevel.Debug, "Loading PartitionSopClass from database");
list = LoadPartitionSopClassesFromDatabase(partition);
cacheClient.Put(cacheKey, list, new CachePutOptions("default", TimeSpan.FromSeconds(30), false /*no sliding. Reload 60 seconds*/));
}
}
}
else
{
list = LoadPartitionSopClassesFromDatabase(partition);
}
return list;
}
示例3: StartPartitionListener
private void StartPartitionListener(ServerPartition part)
{
var parms = new DicomScpContext(part);
if (DicomSettings.Default.ListenIPV4)
{
var ipV4Scp = new DicomScp<DicomScpContext>(parms, AssociationVerifier.Verify,
AssociationAuditLogger.InstancesTransferredAuditLogger)
{
ListenPort = part.Port,
AeTitle = part.AeTitle,
ListenAddress = IPAddress.Any
};
StartScp(ipV4Scp, _listenerList);
}
if (DicomSettings.Default.ListenIPV6)
{
var ipV6Scp = new DicomScp<DicomScpContext>(parms, AssociationVerifier.Verify,
AssociationAuditLogger.InstancesTransferredAuditLogger)
{
ListenPort = part.Port,
AeTitle = part.AeTitle,
ListenAddress = IPAddress.IPv6Any
};
StartScp(ipV6Scp, _listenerList);
}
}
示例4: DeleteSeries
/// <summary>
/// Inserts delete request(s) to delete a series in a study.
/// </summary>
/// <param name="context">The persistence context used for database connection.</param>
/// <param name="partition">The <see cref="ServerPartition"/> where the study resides</param>
/// <param name="studyInstanceUid">The Study Instance Uid of the study</param>
/// <param name="seriesInstanceUids">The Series Instance Uid of the series to be deleted.</param>
/// <param name="reason">The reason for deleting the series.</param>
/// <returns>A list of DeleteSeries <see cref="WorkQueue"/> entries inserted into the system.</returns>
/// <exception cref="InvalidStudyStateOperationException"></exception>
public static IList<WorkQueue> DeleteSeries(IUpdateContext context, ServerPartition partition, string studyInstanceUid, List<string> seriesInstanceUids, string reason)
{
// Find all location of the study in the system and insert series delete request
IList<StudyStorageLocation> storageLocations = StudyStorageLocation.FindStorageLocations(partition.Key, studyInstanceUid);
IList<WorkQueue> entries = new List<WorkQueue>();
foreach (StudyStorageLocation location in storageLocations)
{
try
{
string failureReason;
if (ServerHelper.LockStudy(location.Key, QueueStudyStateEnum.WebDeleteScheduled, out failureReason))
{
// insert a delete series request
WorkQueue request = InsertDeleteSeriesRequest(context, location, seriesInstanceUids, reason);
Debug.Assert(request.WorkQueueTypeEnum.Equals(WorkQueueTypeEnum.WebDeleteStudy));
entries.Add(request);
}
else
{
throw new ApplicationException(String.Format("Unable to lock storage location {0} for deletion : {1}", location.Key, failureReason));
}
}
catch(Exception ex)
{
Platform.Log(LogLevel.Error, ex, "Errors occurred when trying to insert delete request");
if (!ServerHelper.UnlockStudy(location.Key))
throw new ApplicationException("Unable to unlock the study");
}
}
return entries;
}
示例5: DeleteStudy
/// <summary>
/// Inserts delete request(s) to delete a series in a study.
/// </summary>
/// <param name="context">The persistence context used for database connection.</param>
/// <param name="partition">The <see cref="ServerPartition"/> where the study resides</param>
/// <param name="studyInstanceUid">The Study Instance Uid of the study</param>
/// <param name="reason">The reason for deleting the series.</param>
/// <returns>A list of DeleteSeries <see cref="WorkQueue"/> entries inserted into the system.</returns>
/// <exception cref="InvalidStudyStateOperationException"></exception>
public static WorkQueue DeleteStudy(IUpdateContext context, ServerPartition partition, string studyInstanceUid,
string reason)
{
StudyStorageLocation location = FindStudyStorageLocation(context, partition, studyInstanceUid);
string failureReason;
try
{
if (LockStudyForDeletion(location.Key, out failureReason))
{
WorkQueue deleteRequest = InsertDeleteStudyRequest(context, location, reason);
if (deleteRequest == null)
throw new ApplicationException(
String.Format("Unable to insert a Delete Study request for study {0}",
location.StudyInstanceUid));
return deleteRequest;
}
}
catch (Exception ex)
{
Platform.Log(LogLevel.Error, ex, "Errors occurred when trying to insert study delete request");
if (!ReleaseDeletionLock(location.Key))
Platform.Log(LogLevel.Error, "Unable to unlock the study: " + location.StudyInstanceUid);
throw;
}
throw new ApplicationException(
String.Format("Unable to lock storage location {0} for deletion : {1}", location.Key, failureReason));
}
示例6: StudyRulesEngine
public StudyRulesEngine(ServerRulesEngine studyRulesEngine, StudyStorageLocation location, ServerPartition partition, StudyXml studyXml)
{
_studyRulesEngine = studyRulesEngine;
_studyXml = studyXml;
_location = location;
_partition = partition ?? ServerPartition.Load(_location.ServerPartitionKey);
}
示例7: GetPartitionSopClass
/// <summary>
/// Returns the <see cref="PartitionSopClass"/> for the specified sop class and partition or NULL if the sop class UID is not set.
/// </summary>
/// <param name="partition"></param>
/// <param name="sopClassUid"></param>
/// <returns></returns>
public PartitionSopClass GetPartitionSopClass(ServerPartition partition, string sopClassUid)
{
Platform.CheckForNullReference(partition, "partition");
Platform.CheckForEmptyString(sopClassUid, "sopClassUid");
var list = LoadPartitionSopClasses(partition);
return list.SingleOrDefault(entry => entry.SopClassUid == sopClassUid);
}
示例8: SopInstanceImporterContext
/// <summary>
/// Creates an instance of <see cref="SopInstanceImporterContext"/> to be used
/// by <see cref="SopInstanceImporter"/>
/// </summary>
/// <param name="contextID">The ID assigned to the context. This will be used as the name of storage folder in case of duplicate.</param>
/// <param name="sourceAE">Source AE title of the image(s) to be imported</param>
/// <param name="partition">The <see cref="ServerPartition"/> which the image(s) will be imported to</param>
public SopInstanceImporterContext(string contextID, string sourceAE, ServerPartition partition)
{
Platform.CheckForEmptyString(contextID, "contextID");
Platform.CheckForNullReference(partition, "partition");
_contextID = contextID;
_sourceAE = sourceAE;
_partition = partition;
}
示例9: ServerActionContext
public ServerActionContext(DicomMessageBase msg, ServerEntityKey filesystemKey,
ServerPartition partition, ServerEntityKey studyLocationKey)
{
Message = msg;
ServerPartitionKey = partition.Key;
StudyLocationKey = studyLocationKey;
FilesystemKey = filesystemKey;
ServerPartition = partition;
}
示例10: ValidationStudyInfo
public ValidationStudyInfo(Study theStudy, ServerPartition partition)
{
ServerAE = partition.AeTitle;
PatientsName = theStudy.PatientsName;
PatientsId = theStudy.PatientId;
StudyInstaneUid = theStudy.StudyInstanceUid;
AccessionNumber = theStudy.AccessionNumber;
StudyDate = theStudy.StudyDate;
}
示例11: UpdateInstanceCommand
public UpdateInstanceCommand(ServerPartition partition,
StudyStorageLocation studyLocation,
DicomFile file)
: base("Update existing SOP Instance")
{
_partition = partition;
_studyLocation = studyLocation;
_file = file;
}
示例12: ImageServerDbGenerator
public ImageServerDbGenerator(ServerPartition partition, DateTime startDate, int totalStudies, int studiesPerDay, int percentWeekend)
{
_startDate = startDate;
_totalStudies = totalStudies;
_studiesPerDay = studiesPerDay;
_percentWeekend = percentWeekend;
_partition = partition;
_backroundTask = new BackgroundTask(Run, true);
}
示例13: StudyDeleteRecord
public StudyDeleteRecord(ServerPartition partition, string studyInstanceUid, string accessionNumber, string patientId, string patientName)
: base("StudyDeleteRecord")
{
this.ServerPartitionAE = partition.AeTitle;
this.StudyInstanceUid = studyInstanceUid;
this.Timestamp = Platform.Time;
this.AccessionNumber = accessionNumber;
this.PatientId = patientId;
this.PatientsName = patientName;
}
示例14: UpdatePartition
/// <summary>
/// Update the partition whose GUID and new information are specified in <paramref name="partition"/>.
///
/// </summary>
/// <param name="partition"></param>
/// <param name="groupsWithDataAccess"></param>
/// <returns></returns>
public bool UpdatePartition(ServerPartition partition, List<string> groupsWithDataAccess)
{
Platform.Log(LogLevel.Info, "Updating server partition: AETitle = {0}", partition.AeTitle);
bool result = _serverAdapter.Update(partition, groupsWithDataAccess);
if (result)
Platform.Log(LogLevel.Info, "Server Partition updated : AETitle = {0}", partition.AeTitle);
else
Platform.Log(LogLevel.Info, "Failed to update Server Partition: AETitle = {0}", partition.AeTitle);
return result;
}
示例15: AddPartition
/// <summary>
/// Add a partition in the database.
/// </summary>
/// <param name="partition"></param>
/// <param name="groupsWithDataAccess"></param>
public bool AddPartition(ServerPartition partition, List<string> groupsWithDataAccess)
{
Platform.Log(LogLevel.Info, "Adding new server partition : AETitle = {0}", partition.AeTitle);
bool result = _serverAdapter.AddServerPartition(partition, groupsWithDataAccess);
if (result)
Platform.Log(LogLevel.Info, "Server Partition added : AETitle = {0}", partition.AeTitle);
else
Platform.Log(LogLevel.Info, "Failed to add Server Partition: AETitle = {0}", partition.AeTitle);
return result;
}