Created ConsumerLocator skeleton

This commit is contained in:
Scharnitzky Donát 2020-03-29 15:54:52 +02:00
parent bd71f86aa1
commit 42a47d9bbe

View File

@ -11,6 +11,40 @@ __copyright__ = "Copyright 2020, GoldenPogácsa Team"
__module_name__ = "consumerlocator" __module_name__ = "consumerlocator"
__version__text__ = "1" __version__text__ = "1"
class ConsumerLocator: class ConsumerLocator:
def __init__(self): def __init__(self):
self.consumerList = ["KnownHost"]
self.currentConsumer = self.consumerList[0]
pass 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