Sha256: b59ef97c48dbcf65ce380cfaaa66e034a33cbf6eef6c183907b7469fda40338b

Contents?: true

Size: 796 Bytes

Versions: 11

Compression:

Stored size: 796 Bytes

Contents

module JFlow
  class Domain

    attr_reader :domain_name

    def initialize(domain_name)
      @domain_name = domain_name
      create unless exists?
    end

    def create
      JFlow.configuration.logger.debug "Registering domain #{domain_name}"
      JFlow.configuration.swf_client.register_domain({
        name: domain_name,
        description: domain_name,
        workflow_execution_retention_period_in_days: "90"
      })
    end

    def exists?
      domains = JFlow.configuration.swf_client.list_domains({
        registration_status: "REGISTERED"
      })
      exists = domains.domain_infos
                      .map{|a| a.name}
                      .include?(domain_name)
      JFlow.configuration.logger.debug "#{domain_name} found: #{exists}"
      exists
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jflow-0.5.1 lib/jflow/domain.rb
jflow-0.5.0 lib/jflow/domain.rb
jflow-0.4.5 lib/jflow/domain.rb
jflow-0.4.4 lib/jflow/domain.rb
jflow-0.4.3 lib/jflow/domain.rb
jflow-0.4.2 lib/jflow/domain.rb
jflow-0.4.1 lib/jflow/domain.rb
jflow-0.4.0 lib/jflow/domain.rb
jflow-0.3.6 lib/jflow/domain.rb
jflow-0.3.5 lib/jflow/domain.rb
jflow-0.3.4 lib/jflow/domain.rb