Ahenk/opt/ahenk/base/model/message_factory.py

18 lines
540 B
Python
Raw Normal View History

2016-03-14 10:55:28 +02:00
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
2016-08-24 18:00:01 +03:00
from base.model.enum.message_type import MessageType
2016-03-14 10:55:28 +02:00
class MessageFactory(object):
def createMessage(self, type, message):
2016-03-14 10:55:28 +02:00
if type == MessageType.TASK_RECEIVED:
return "Message receivden response"
elif type == MessageType.TASK_PROCESSING:
return "Message processing response"
2016-03-14 17:42:17 +02:00
else:
2016-03-14 10:55:28 +02:00
return None
2016-03-14 10:55:28 +02:00
createMessage = staticmethod(createMessage)