Merge branch 'master' of ssh://naparuba@shinken.git.sourceforge.net/gitroot/shinken...
[shinken.git] / shinken / message.py
blob7def1703c0575da027f07726309ae0cf06112fa9
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
7 #This file is part of Shinken.
9 #Shinken is free software: you can redistribute it and/or modify
10 #it under the terms of the GNU Affero General Public License as published by
11 #the Free Software Foundation, either version 3 of the License, or
12 #(at your option) any later version.
14 #Shinken is distributed in the hope that it will be useful,
15 #but WITHOUT ANY WARRANTY; without even the implied warranty of
16 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 #GNU Affero General Public License for more details.
19 #You should have received a copy of the GNU Affero General Public License
20 #along with Shinken. If not, see <http://www.gnu.org/licenses/>.
23 #Tis is a simple message class for communications between actionners and
24 #workers
27 class Message:
28 _type = None
29 _data = None
30 _from = None
31 def __init__(self, id, type, data=None):
32 self._type = type
33 self._data = data
34 self._from = id
37 def get_type(self):
38 return self._type
41 def get_data(self):
42 return self._data
44 def get_from(self):
45 return self._from
48 def str(self):
49 return "Message from %d, Type: %s Data: %s" % (self._from, self._type, self._data)