Inheritance: Stratosphere.Aws.AmazonWebService
Ejemplo n.º 1
0
        public static bool TryCreate(string serviceId, string serviceSecret, string queueName, bool ensureQueue, out SqsQueue queue)
        {
            SqsService service = new SqsService(serviceId, serviceSecret);
            SqsQueue[] queues = ListQueues(service).ToArray();

            foreach (SqsQueue q in queues)
            {
                if (q.Name.Equals(queueName, StringComparison.InvariantCultureIgnoreCase))
                {
                    queue = q;
                    return true;
                }
            }

            if (ensureQueue)
            {
                queue = Create(service, queueName);
                return true;
            }

            queue = null;
            return false;
        }
Ejemplo n.º 2
0
        public static bool TryCreate(string serviceId, string serviceSecret, string queueName, bool ensureQueue, out SqsQueue queue)
        {
            SqsService service = new SqsService(serviceId, serviceSecret);

            SqsQueue[] queues = ListQueues(service).ToArray();

            foreach (SqsQueue q in queues)
            {
                if (q.Name.Equals(queueName, StringComparison.InvariantCultureIgnoreCase))
                {
                    queue = q;
                    return(true);
                }
            }

            if (ensureQueue)
            {
                queue = Create(service, queueName);
                return(true);
            }

            queue = null;
            return(false);
        }
Ejemplo n.º 3
0
        public static IEnumerable<SqsQueue> ListQueues(string serviceId, string serviceSecret)
        {
            SqsService service = new SqsService(serviceId, serviceSecret);

            return ListQueues(service);
        }
Ejemplo n.º 4
0
 public static SqsQueue Create(string serviceId, string serviceSecret, string queueName)
 {
     SqsService service = new SqsService(serviceId, serviceSecret);
     return Create(service, queueName);
 }
Ejemplo n.º 5
0
 private SqsQueue(Uri uri, SqsService service)
 {
     _uri = uri;
     _service = service;
 }
Ejemplo n.º 6
0
 private static IEnumerable<SqsQueue> ListQueues(SqsService service)
 {
     return service.Execute(new ListQueuesBuilder()).Descendants(Sqs + "QueueUrl").Select(
         url => new SqsQueue(new Uri(url.Value + "/"), service));
 }
Ejemplo n.º 7
0
 private static SqsQueue Create(SqsService service, string queueName)
 {
     return new SqsQueue(new Uri(service.Execute(new CreateQueueBuilder(queueName)).Descendants(Sqs + "QueueUrl").First().Value + "/"), service);
 }
Ejemplo n.º 8
0
        public static SqsQueue Create(string serviceId, string serviceSecret, string queueName)
        {
            SqsService service = new SqsService(serviceId, serviceSecret);

            return(Create(service, queueName));
        }
Ejemplo n.º 9
0
        public static IEnumerable <SqsQueue> ListQueues(string serviceId, string serviceSecret)
        {
            SqsService service = new SqsService(serviceId, serviceSecret);

            return(ListQueues(service));
        }
Ejemplo n.º 10
0
 private static SqsQueue Create(SqsService service, string queueName)
 {
     return(new SqsQueue(new Uri(service.Execute(new CreateQueueBuilder(queueName)).Descendants(Sqs + "QueueUrl").First().Value + "/"), service));
 }
Ejemplo n.º 11
0
 private static IEnumerable <SqsQueue> ListQueues(SqsService service)
 {
     return(service.Execute(new ListQueuesBuilder()).Descendants(Sqs + "QueueUrl").Select(
                url => new SqsQueue(new Uri(url.Value + "/"), service)));
 }
Ejemplo n.º 12
0
 private SqsQueue(Uri uri, SqsService service)
 {
     _uri     = uri;
     _service = service;
 }