SoarSr
SoarSr is a client library for accessing the features of a jUDDI registry. SoarSr translates jUDDI concepts into a SOA architectural view on UDDI storage. Services are concise singly responsible functional units. Service components are devices and application servers that offer services on a URI. Domain perspectives are functional grouping of services et al in pursuit of business goals. Teams are a kind of domain perspective. Services are described by wadl service definitions. Associating services or service components with domain perspectvice indicates functional association. Associating services or service components with teams indicate ownership. Domain perspectives (and so also teams) have one or more contacts associated.
This is accomplished by translating as follows:
Teams and Domain perspectives => jUDDI businesses Service components and services => jUDDI services Associations => ruby Hashes, url encoded in an entity's description
Installation
Add this line to your application's Gemfile:
gem 'soar_sr'
And then execute:
bundle
Or install it yourself as:
gem install soar_sr
Usage
spec.add_development_dependency 'soar_sr'
bundle exec irb
Helpers
require 'soar_sr'
credentials = { 'username' => 'uddi', 'password' => 'uddi' }
freshness = 0 # > 0 to enable cache
@soar_sr = SoarSr::ServiceRegistry.new('http://localhost:8080', 'hetzner.co.za', 'hetzner', credentials, freshness)
ds = @soar_sr.domain_perspectives
sv = @soar_sr.services
sc = @soar_sr.service_components
sd = @soar_sr.service_definitions
ts = @soar_sr.teams
cc = @soar_sr.contacts
as = @soar_sr.associations
ss = @soar_sr.search
Domain perspectives
ds.delete_all_domain_perspectives
ds.list_domain_perspectives
ds.domain_perspective_by_name('domains', 'my domain')
ds.domain_perspective_registered?('my domain')
ds.register_domain_perspective('my domain')
ds.domain_perspective_registered?('my domain')
ds.deregister_domain_perspective('my domain')
ds.list_domain_perspectives
Services
sv.register_service({'name' => 'my service', 'description' => 'a new service', 'definition' => 'http://de.finiti.on'})
sv.service_registered?('my service')
sv.add_service_uri('my service', 'http://one-uri.com/my_service')
sv.add_service_uri('my service', 'http://find-me-here.com/my_service')
sv.remove_uri_from_service('my service', 'http://one-uri.com/my_service')
sv.service_uris('my service')
sv.('my service', {'some' => 'meta'})
sv.('my service')
sv.service_by_name('my service')
sv.deregister_service('my service')
sv.service_by_name('my service')
Service components
sc.delete_all_service_components
sc.list_service_components
sc.register_service_component('my sc')
sc.service_component_registered?('my sc')
sc.configure_service_component_uri('my sc', 'http://my-sc.com')
sc.service_component_uri('my sc')
sc.deregister_service_component('my sc')
sc.service_component_registered?('my sc')
Service definitions
sv.register_service({'name' => 'my service', 'description' => 'a new service', 'definition' => 'http://de.finiti.on'})
sd.service_definition_for_service('my service')
sd.deregister_service_definition('my service')
sd.service_definition_for_service('my service')
sd.register_service_definition('my service', 'http://github.com/myservice/def.wadl')
sd.service_definition_for_service('my service')
Teams
ts.team_registered?('my team')
ts.register_team('my team')
ds.domain_perspective_by_name('teams', 'my team')
ts.team_registered?('my team')
ts.deregister_team('my team')
ts.team_registered?('my team')
Contacts
contact = { 'name' => 'Peter Umpkin', 'email' => '[email protected]', 'description' => 'Director of operations', 'phone' => '0917872413'}
contact2 = { 'name' => 'Bruce Atman', 'email' => '[email protected]', 'description' => 'Head of sales'}
ds.register_domain_perspective('my domain')
cc.add_contact_to_domain_perspective('my domain', contact)
cc.add_contact_to_domain_perspective('my domain', contact2)
cc.contact_details_for_domain('my domain')
cc.remove_contact_from_domain_perspective('my domain', contact)
ts.register_team('my team')
cc.add_contact_to_domain_perspective('my team', contact2)
cc.contact_details_for_domain('my team')
Associations
ds.register_domain_perspective('my domain')
as.delete_all_domain_perspective_associations('my domain')
sc.register_service_component('my sc')
as.associate_service_component_with_domain_perspective('my sc', 'my domain')
as.service_component_has_domain_perspective_associations?('my sc')
as.domain_perspective_associations('my domain')
as.domain_perspective_has_associations?('my domain')
as.disassociate_service_component_from_domain_perspective('my domain', 'my sc')
as.service_component_has_domain_perspective_associations?('my sc')
as.domain_perspective_has_associations?('my domain')
ds.register_domain_perspective('my domain')
as.delete_all_domain_perspective_associations('my domain')
sv.register_service({'name' => 'my service', 'description' => 'a new service', 'definition' => 'http://de.finiti.on'})
as.associate_service_with_domain_perspective('my service', 'my domain')
as.domain_perspective_has_associations?('my domain')
as.domain_perspective_associations('my domain')
as.disassociate_service_from_domain_perspective('my domain', 'my service')
as.domain_perspective_associations('my domain')
Search
sv.register_service({'name' => 'search me', 'description' => 'pretty please', 'definition' => 'http://de.finiti.on'})
sv.add_service_uri('search me', 'https://this.is.another.one/ybo')
sv.add_service_uri('search me', 'http://some.where.net/smoothies')
sv.service_uris('search me')
sv.remove_uri_from_service('search me', 'https://this.is.another.one/ybo')
ss.search_for_service('search')
ss.search_for_service('please')
ss.search_for_service('ti.on')
ds.register_domain_perspective('my domain')
as.associate_service_with_domain_perspective('search me', 'my domain')
ss.search_domain_perspective('my domain', 'search')
ss.search_domain_perspective('my domain', 'please')
ss.search_domain_perspective('my domain', 'ti.on')
ss.search_for_service_by_name('search')
ss.search_for_service_by_name('please')
ss.search_for_service_by_name('ti.on')
Contributing
Bug reports and feature requests are welcome by email to ernstv dot van dot graan at hetzner dot co dot za. This gem is sponsored by Hetzner (Pty) Ltd (http://hetzner.co.za)
License
The gem is available as open source under the terms of the MIT License.