*A little cleanup in the livestatus test
[shinken.git] / shinken / message.py
blobe2c046be8c2fb0aab657ba3233755d2b270e4550
1 #!/usr/bin/env python
2 #Copyright (C) 2009-2010 :
3 # Gabes Jean, naparuba@gmail.com
4 # Gerhard Lausser, Gerhard.Lausser@consol.de
6 #This file is part of Shinken.
8 #Shinken is free software: you can redistribute it and/or modify
9 #it under the terms of the GNU Affero General Public License as published by
10 #the Free Software Foundation, either version 3 of the License, or
11 #(at your option) any later version.
13 #Shinken is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 #GNU Affero General Public License for more details.
18 #You should have received a copy of the GNU Affero General Public License
19 #along with Shinken. If not, see <http://www.gnu.org/licenses/>.
22 #Tis is a simple message class for communications between actionners and
23 #workers
26 class Message:
27 _type = None
28 _data = None
29 _from = None
30 def __init__(self, id, type, data=None):
31 self._type = type
32 self._data = data
33 self._from = id
36 def get_type(self):
37 return self._type
40 def get_data(self):
41 return self._data
43 def get_from(self):
44 return self._from
47 def str(self):
48 return "Message from %d, Type: %s Data: %s" % (self._from, self._type, self._data)