internal TransStream ExecRequset(IQueueMessage request) { try { if (request.QCommand == QueueCmd.QueueHasValue) { return(MessageAckServer.DoReportValue(QueueCount(request.Host))); } QLogger.DebugFormat("QueueController ExecRequset : {0}", request.Print()); switch (request.QCommand) { case QueueCmd.Enqueue: MQueue Q = Get(request.Host); var ack = ExecSet((QueueItem)request); return(MessageAckServer.DoResponse(ack)); case QueueCmd.Dequeue: case QueueCmd.DequeuePriority: case QueueCmd.DequeueItem: case QueueCmd.Peek: case QueueCmd.PeekPriority: case QueueCmd.PeekItem: return(MessageAckServer.DoResponse(ExecGet(request), MessageState.Receiving)); case QueueCmd.Commit: break; case QueueCmd.Abort: break; //operation case QueueCmd.AddQueue: MQueue mq = null; return(MessageAckServer.DoResponse(AddQueue(new QProperties(request.BodyStream), out mq))); case QueueCmd.RemoveQueue: return(MessageAckServer.DoResponse(RemoveQueue(request.Host))); case QueueCmd.HoldEnqueue: throw new Exception("Operation not supported"); case QueueCmd.NoneHoldEnqueue: throw new Exception("Operation not supported"); case QueueCmd.HoldDequeue: throw new Exception("Operation not supported"); case QueueCmd.NoneHoldDequeue: throw new Exception("Operation not supported"); case QueueCmd.EnableQueue: throw new Exception("Operation not supported"); case QueueCmd.DisableQueue: throw new Exception("Operation not supported"); case QueueCmd.ClearQueue: throw new Exception("Operation not supported"); //reports case QueueCmd.Exists: return(MessageAckServer.DoResponse(Exists(request.Host))); case QueueCmd.ReportQueueList: var list = GetQueueList(); return(new TransStream(list)); case QueueCmd.QueueProperty: case QueueCmd.ReportQueueItems: return(ExecQuery(request)); case QueueCmd.ReportQueueStatistic: return(GetQueueReport(request)); //throw new Exception("Operation not supported"); case QueueCmd.PerformanceCounter: throw new Exception("Operation not supported"); case QueueCmd.QueueCount: return(MessageAckServer.DoReport(QueueCount(request.Host), QueueCmd.QueueCount, MessageState.Ok, null)); } } catch (MessageException mex) { QLogger.Exception("ExecGet MessageException: ", mex, true); return(MessageAckServer.DoError(mex.MessageState, request.QCommand, mex)); } catch (ArgumentException ase) { QLogger.Exception("ExecGet ArgumentException: ", ase, true, true); return(MessageAckServer.DoError(MessageState.ArgumentsError, request.QCommand, ase)); } catch (SerializationException se) { QLogger.Exception("ExecGet SerializationException: ", se, true); return(MessageAckServer.DoError(MessageState.SerializeError, request.QCommand, se)); } catch (Exception ex) { QLogger.Exception("ExecGet Exception: ", ex, true, true); return(MessageAckServer.DoError(MessageState.UnExpectedError, request.QCommand, ex)); } return(null); }