Package Products :: Package DataCollector :: Module BaseClient
[hide private]
[frames] | no frames]

Source Code for Module Products.DataCollector.BaseClient

 1  ############################################################################## 
 2  #  
 3  # Copyright (C) Zenoss, Inc. 2008, all rights reserved. 
 4  #  
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  #  
 8  ############################################################################## 
 9   
10   
11  __doc__ = """BaseClient 
12  Base class for the client interface for data collection 
13  """ 
14   
15 -class BaseClient(object):
16 """ 17 Define the DataCollector Client interface 18 """ 19
20 - def __init__(self, device, datacollector):
21 """ 22 Initializer 23 24 @param device: remote device to use the datacollector 25 @type device: device object 26 @param datacollector: performance data collector object 27 @type datacollector: datacollector object 28 """ 29 self.hostname = None 30 if device: 31 self.hostname = device.id 32 self.device = device 33 self.datacollector = datacollector 34 self.timeout = None 35 self.timedOut = False
36
37 - def run(self):
38 """ 39 Start the data gathering. 40 To be implemented by child classes 41 """ 42 pass
43
44 - def stop(self):
45 """ 46 Stopping condition for the collector. 47 To be implemented by child classes 48 """ 49 pass
50
51 - def getResults(self):
52 """ 53 Return the results of the data collection. 54 To be implemented by child classes 55 56 @return: list of results 57 @rtype: list of results 58 """ 59 return []
60