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

# Source Code for Module Products.DataCollector.BaseClient

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2008, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  __doc__ = """BaseClient
    15  Base class for the client interface for data collection
    16  """
    17
    18 -class BaseClient(object):
    19      """
    20      Define the DataCollector Client interface
    21      """
    22
    23 -    def __init__(self, device, datacollector):
    24          """
    25          Initializer
    26
    27          @param device: remote device to use the datacollector
    28          @type device: device object
    29          @param datacollector: performance data collector object
    30          @type datacollector: datacollector object
    31          """
    32          self.hostname = None
    33          if device:
    34              self.hostname = device.id
    35          self.device = device
    36          self.datacollector = datacollector
    37          self.timeout = None
    38          self.timedOut = False
    39
    40 -    def run(self):
    41          """
    42          Start the data gathering.
    43          To be implemented by child classes
    44          """
    45          pass
    46
    47 -    def stop(self):
    48          """
    49          Stopping condition for the collector.
    50          To be implemented by child classes
    51          """
    52          pass
    53
    54 -    def getResults(self):
    55          """
    56          Return the results of the data collection.
    57          To be implemented by child classes
    58
    59          @return: list of results
    60          @rtype: list of results
    61          """
    62          return []
    63