Exemple #1
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            IEnumerable <QueueDescriptor> queueDescriptors;

            if (_options.Public)
            {
                queueDescriptors = tools.GetPublicQueuesByMachine(_options.Machine, TransactionFromFlags(_options.Transactional, _options.NonTransactional));
            }
            else
            {
                queueDescriptors = tools.GetPrivateQueues(_options.Machine, TransactionFromFlags(_options.Transactional, _options.NonTransactional));
            }

            if (!string.IsNullOrEmpty(_options.Filter))
            {
                queueDescriptors = Filter(_options.Filter, queueDescriptors);
            }

            IReporter r;

            if (!string.IsNullOrEmpty(_options.DumpFile))
            {
                r = new JsonFileReporter(queueDescriptors, _options.DumpFile);
            }
            else
            {
                r = new LineReporter(queueDescriptors);
            }

            r.Report(log);
            return(true);
        }
Exemple #2
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            IEnumerable<QueueDescriptor> queueDescriptors;
            if(_options.Public)
            {
                queueDescriptors = tools.GetPublicQueuesByMachine(_options.Machine, TransactionFromFlags(_options.Transactional, _options.NonTransactional));
            }
            else
            {
                queueDescriptors = tools.GetPrivateQueues(_options.Machine, TransactionFromFlags(_options.Transactional, _options.NonTransactional));
            }

            if(!string.IsNullOrEmpty(_options.Filter))
            {
                queueDescriptors = Filter(_options.Filter, queueDescriptors);
            }

            IReporter r;

            if(!string.IsNullOrEmpty(_options.DumpFile))
            {
                r = new JsonFileReporter(queueDescriptors, _options.DumpFile);
            }
            else
            {
                r = new LineReporter(queueDescriptors);
            }

            r.Report(log);
            return true;
        }