Class: LS4::MDSCacheConfigService

Inherits:
Service show all
Defined in:
lib/ls4/service/mds_cache.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



45
46
47
# File 'lib/ls4/service/mds_cache.rb', line 45

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

Instance Method Details

#on_changeObject



49
50
51
52
# File 'lib/ls4/service/mds_cache.rb', line 49

def on_change
	SyncBus.update(SYNC_MDS_CACHE_URI,
						@uri, MDSCacheConfigService.hash_uri(@uri))
end

#rpc_get_mds_cache_uriObject



35
36
37
# File 'lib/ls4/service/mds_cache.rb', line 35

def rpc_get_mds_cache_uri
	@uri
end

#rpc_set_mds_cache_uri(uri) ⇒ Object



39
40
41
42
43
# File 'lib/ls4/service/mds_cache.rb', line 39

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

#runObject



29
30
31
32
33
# File 'lib/ls4/service/mds_cache.rb', line 29

def run
	@uri = ConfigBus.get_initial_mds_cache_uri
	@uri ||= "null"
	on_change
end