ClearCanvas.ImageServer.Services.Streaming.Shreds.ImageStreamingServer.Validate C# (CSharp) Method

Validate() private static method

private static Validate ( HttpListenerContext context ) : void
context System.Net.HttpListenerContext
return void
        private static void Validate(HttpListenerContext context)
        {
            string serverAE = UriHelper.GetServerAE(context);

            if (String.IsNullOrEmpty(serverAE))
            {
                throw new HttpException((int)HttpStatusCode.BadRequest, 
                    String.Format("Partition AE Title is required after {0}", ImageStreamingServerSettings.Default.Path));
            }

            ServerPartition partition = ServerPartitionMonitor.Instance.GetPartition(serverAE);
            if (partition == null)
            {
                throw new HttpException((int)HttpStatusCode.BadRequest, String.Format("Partition AE {0} is invalid", serverAE));
            }

            string requestType = context.Request.QueryString["requestType"] ?? "";
            if (String.IsNullOrEmpty(requestType))
            {
                throw new WADOException(HttpStatusCode.BadRequest, "RequestType parameter is missing");
            }
        }