summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringService/Resource/resource.py
diff options
context:
space:
mode:
authorpikusa <pikusa@man.poznan.pl>2013-04-03 13:18:17 (GMT)
committer pikusa <pikusa@man.poznan.pl>2013-04-03 13:18:17 (GMT)
commit2f2a3a129c91de540e66c3bfbe30b0df1942cd4b (patch)
tree2d313cdf0068af368d4de6067d676be16f6a6464 /Monitoring/MonitoringService/Resource/resource.py
parentff8aa232b071a9b54dff833714a870fd0aec0b30 (diff)
downloadnovi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.zip
novi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.tar.gz
novi-public-2f2a3a129c91de540e66c3bfbe30b0df1942cd4b.tar.bz2
project commit and dir tree change
Diffstat (limited to 'Monitoring/MonitoringService/Resource/resource.py')
-rw-r--r--Monitoring/MonitoringService/Resource/resource.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/Monitoring/MonitoringService/Resource/resource.py b/Monitoring/MonitoringService/Resource/resource.py
new file mode 100644
index 0000000..fb093bd
--- /dev/null
+++ b/Monitoring/MonitoringService/Resource/resource.py
@@ -0,0 +1,44 @@
+'''
+Created on May 31, 2012
+
+@author: steger
+'''
+
+class resource(object):
+ def __init__(self, name = None, resourceid = None):
+ self._name = name
+ self._resourceid = resourceid
+
+ @staticmethod
+ def ipret(x):
+ if not x:
+ return None
+ x = str(x)
+ if len(x):
+ return x
+ else:
+ return None
+
+ @property
+ def name(self):
+ if self._name is None:
+ raise Exception("resource name is not set")
+ return self._name
+ @name.setter
+ def name(self, name):
+ self._name = self.ipret(name)
+ @name.deleter
+ def name(self):
+ self._name = None
+
+ @property
+ def resourceid(self):
+ if self._resourceid is None:
+ raise Exception("resource id is not set")
+ return self._resourceid
+ @resourceid.setter
+ def resourceid(self, resourceid):
+ self._resourceid = resourceid
+ @resourceid.deleter
+ def resourceid(self):
+ self._resourceid = None \ No newline at end of file