diff --git a/ConsumerLocator.py b/ConsumerLocator.py index 8e95b4c..22ac703 100644 --- a/ConsumerLocator.py +++ b/ConsumerLocator.py @@ -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