Sha256: fa7fb8261ddef8ed768bb9129ed0165300578ee9198f7cee2bfa5dda36d9ecad

Contents?: true

Size: 1.65 KB

Versions: 37

Compression:

Stored size: 1.65 KB

Contents

require 'jsender'
require 'soap4juddi'

module SoarSr
  class ServiceDefinitions < SoarSr::Handler
    include Jsender
    
    def register_service_definition(service, definition)_{
      service = standardize(service)            
      authorize 
      provided?(service, 'service') and registered?(service, 'services') and provided?(definition, 'service definition') and wadl?(definition)
      result = @uddi.get_service(service)
      service = result['data']
      service['definition'] = definition
      result = @uddi.save_service(service['name'], service['description'], service['definition'])
      authorized?(result) and identifier?(result, 'service')
      success('service definition registered')
    }end

    def service_definition_for_service(service)_{
      service = standardize(service)            
      # byebug
      provided?(service, 'service') and registered?(service, 'services')
      result = @uddi.get_service(service)['data']
      identifier?(result, 'service')
      return fail('service has no definition') if (result['definition'].nil?) or (result['definition'] == "")
      success_data({'definition' => result['definition']})
    }end

    def deregister_service_definition(service)_{
      service = standardize(service)            
      authorize
      provided?(service, 'service') and registered?(service, 'services')
      result = @uddi.get_service(service)
      service = result['data']
      service['definition'] = ""
      result = @uddi.save_service(service['name'], service['description'], service['definition'])
      authorized?(result) and identifier?(result, 'service')
      success('service definition deregistered')
    }end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
soar_sr-1.1.6 lib/soar_sr/service_definitions.rb
soar_sr-1.1.5 lib/soar_sr/service_definitions.rb
soar_sr-1.1.4 lib/soar_sr/service_definitions.rb
soar_sr-1.1.2 lib/soar_sr/service_definitions.rb
soar_sr-1.1.1 lib/soar_sr/service_definitions.rb
soar_sr-1.1.0 lib/soar_sr/service_definitions.rb
soar_sr-1.0.2 lib/soar_sr/service_definitions.rb
soar_sr-0.1.19 lib/soar_sr/service_definitions.rb
soar_sr-0.1.18 lib/soar_sr/service_definitions.rb
soar_sr-0.1.17 lib/soar_sr/service_definitions.rb
soar_sr-0.1.16 lib/soar_sr/service_definitions.rb
soar_sr-0.1.14 lib/soar_sr/service_definitions.rb
soar_sr-0.1.13 lib/soar_sr/service_definitions.rb
soar_sr-0.1.12 lib/soar_sr/service_definitions.rb
soar_sr-0.1.11 lib/soar_sr/service_definitions.rb
soar_sr-0.1.10 lib/soar_sr/service_definitions.rb
soar_sr-0.1.9 lib/soar_sr/service_definitions.rb