Created ConsumerLocator skeleton
This commit is contained in:
parent
bd71f86aa1
commit
42a47d9bbe
@ -11,6 +11,40 @@ __copyright__ = "Copyright 2020, GoldenPogácsa Team"
|
||||
__module_name__ = "consumerlocator"
|
||||
__version__text__ = "1"
|
||||
|
||||
|
||||
class ConsumerLocator:
|
||||
|
||||
def __init__(self):
|
||||
self.consumerList = ["KnownHost"]
|
||||
self.currentConsumer = self.consumerList[0]
|
||||
pass
|
||||
|
||||
def learnConsumerList(self):
|
||||
""""
|
||||
Learns the list of consumers.
|
||||
"""
|
||||
pass
|
||||
|
||||
def updateConsumer(self):
|
||||
"""
|
||||
Updates the current consumer.
|
||||
:return:
|
||||
"""
|
||||
self.currentConsumer = self.consumerList[0]
|
||||
|
||||
def getCurrentConsumer(self):
|
||||
"""
|
||||
Returns the currently selected consumer.
|
||||
:return: the current consumer
|
||||
"""
|
||||
return self.currentConsumer
|
||||
|
||||
def checkConsumer(self):
|
||||
"""
|
||||
Check the consumers health.
|
||||
:return: True if OK, False if fail
|
||||
"""
|
||||
if communicator.ping(self.currentConsumer):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
Reference in New Issue
Block a user