Ejemplo n.º 1
0
        static void RegisterDomain()
        {
            // Register if the domain is not already registered.
            var listDomainRequest = new ListDomainsRequest()
            {
                RegistrationStatus = RegistrationStatus.REGISTERED
            };

            if (SwfClient.ListDomains(listDomainRequest).DomainInfos.Infos.FirstOrDefault(
                    x => x.Name == domainName) == null)
            {
                var request = new RegisterDomainRequest()
                {
                    Name        = domainName,
                    Description = "Swf Demo",
                    WorkflowExecutionRetentionPeriodInDays = "1"
                };

                Console.WriteLine("INITIATOR: Created Domain - " + domainName);
                try
                {
                    SwfClient.RegisterDomain(request);
                }
                catch (DomainAlreadyExistsException dex)
                {
                }
            }
        }
Ejemplo n.º 2
0
        IEnumerable <ListDomainsResponse> IPaginator <ListDomainsResponse> .Paginate()
        {
            if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
            {
                throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
            }
            var nextPageToken = _request.NextPageToken;
            ListDomainsResponse response;

            do
            {
                _request.NextPageToken = nextPageToken;
                response      = _client.ListDomains(_request);
                nextPageToken = response.DomainInfos.NextPageToken;
                yield return(response);
            }while (nextPageToken != null);
        }
Ejemplo n.º 3
0
        public static void RegisterDomain(IAmazonSimpleWorkflow swfClient, string domainName)
        {
            // Register if the domain is not already registered.
            var listDomainRequest = new ListDomainsRequest()
            {
                RegistrationStatus = RegistrationStatus.REGISTERED
            };

            if (swfClient.ListDomains(listDomainRequest).DomainInfos.Infos.FirstOrDefault(
                    x => x.Name == domainName) == null)
            {
                RegisterDomainRequest request = new RegisterDomainRequest()
                {
                    Name        = domainName,
                    Description = "Hello World Demo",
                    WorkflowExecutionRetentionPeriodInDays = "1"
                };

                Console.WriteLine("Setup: Created Domain - " + domainName);
                swfClient.RegisterDomain(request);
            }
        }
Ejemplo n.º 4
0
 private Amazon.SimpleWorkflow.Model.ListDomainsResponse CallAWSServiceOperation(IAmazonSimpleWorkflow client, Amazon.SimpleWorkflow.Model.ListDomainsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Simple Workflow Service (SWF)", "ListDomains");
     try
     {
         #if DESKTOP
         return(client.ListDomains(request));
         #elif CORECLR
         return(client.ListDomainsAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }