示例#1
0
        internal TransStream ExecQuery(IQueueMessage request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("QueueManager.ExecQuery request");
            }
            if (request.Host == null)
            {
                throw new ArgumentNullException("QueueManager.ExecQuery request.Host is invalid");
            }

            MQueue Q = Get(request.Host);

            if (Q == null)
            {
                throw new MessageException(MessageState.InvalidMessageHost, "request.HostName not found " + request.Host);
            }

            switch (request.QCommand)
            {
            case QueueCmd.QueueProperty:
                var res = Q.Property();    //.QueueProperty();
                return(new TransStream(res));

            case QueueCmd.ReportQueueItems:
                var items = Q.QueryItems();
                return(new TransStream(items));

            default:
                throw new NotSupportedException(request.QCommand.ToString());
            }
        }