Class: LS4::MDSConfigService

Inherits:
Service show all
Defined in:
lib/ls4/service/mds.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Service

init

Methods included from EventBus::SingletonMixin

#ebus_bind!, #ebus_connect, extended

Methods included from EventBus::BusMixin

#ebus_all_slots, #ebus_disconnect!

Methods included from EventBus::DeclarerBase::Methods

#connect, #ebus_all_slots, #ebus_call_log, #ebus_call_slots, #ebus_signal_error, #ebus_signal_log, #ebus_signal_slots

Methods included from EventBus::DeclarerBase

#call_slot, #signal_slot

Class Method Details

.hash_uri(uri) ⇒ Object



78
79
80
# File 'lib/ls4/service/mds.rb', line 78

def self.hash_uri(uri)
	Digest::SHA1.digest(uri)
end

Instance Method Details

#on_changeObject



82
83
84
85
# File 'lib/ls4/service/mds.rb', line 82

def on_change
	SyncBus.update(SYNC_MDS_URI,
						@uri, MDSConfigService.hash_uri(@uri))
end

#rpc_get_mds_uriObject



68
69
70
# File 'lib/ls4/service/mds.rb', line 68

def rpc_get_mds_uri
	@uri
end

#rpc_set_mds_uri(uri) ⇒ Object



72
73
74
75
76
# File 'lib/ls4/service/mds.rb', line 72

def rpc_set_mds_uri(uri)
	@uri = uri
	on_change
	nil
end

#runObject



63
64
65
66
# File 'lib/ls4/service/mds.rb', line 63

def run
	@uri = ConfigBus.get_initial_mds_uri
	on_change
end