Fix : get back LiveStatus as default.
[shinken.git] / shinken / message.py
blobf7ae79e50d4bc6588c193ee61d43c1a351034ead
1 #!/usr/bin/env python
2 #Copyright (C) 2009-2010 :
3 # Gabes Jean, naparuba@gmail.com
4 # Gerhard Lausser, Gerhard.Lausser@consol.de
5 # Gregory Starck, g.starck@gmail.com
6 # Hartmut Goebel, h.goebel@goebel-consult.de
8 #This file is part of Shinken.
10 #Shinken is free software: you can redistribute it and/or modify
11 #it under the terms of the GNU Affero General Public License as published by
12 #the Free Software Foundation, either version 3 of the License, or
13 #(at your option) any later version.
15 #Shinken is distributed in the hope that it will be useful,
16 #but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 #GNU Affero General Public License for more details.
20 #You should have received a copy of the GNU Affero General Public License
21 #along with Shinken. If not, see <http://www.gnu.org/licenses/>.
24 #Tis is a simple message class for communications between actionners and
25 #workers
28 class Message:
29 _type = None
30 _data = None
31 _from = None
32 def __init__(self, id, type, data=None):
33 self._type = type
34 self._data = data
35 self._from = id
38 def get_type(self):
39 return self._type
42 def get_data(self):
43 return self._data
45 def get_from(self):
46 return self._from
49 def str(self):
50 return "Message from %d, Type: %s Data: %s" % (self._from, self._type, self._data)