Package Products :: Package ZenModel :: Module Link |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenModel.Link

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, 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  from Products.ZenModel.ZenModelRM import ZenModelRM
    12  from Products.ZenRelations.RelSchema import *
    13
    14
    15 -class ILink(object):
    16      """ Defines the interface for Link-like objects, which
    17          represent a connection between two devices or components
    18      """
    19
    20      link_type = ''
    21      OSI_layer = ''
    22      entry_type = ''
    23
    24 -    def getStatus(self):
    25          """ Returns the event status, determined by:
    26                  Pingdown on Device owning either endpoint
    27                  Most severe event on either endpoint
    28          """
    29          raise NotImplementedError
    30
    31 -    def setEndpoints(self, pointa, pointb):
    32          """ Sets the two endpoints of a link-like object """
    33          raise NotImplementedError
    34
    35 -    def getEndpointNames(self):
    36          """ Returns unique endpoint names (see Linkable.getEndpointName)"""
    37          raise NotImplementedError
    38
    39 -    def getOtherEndpoint(self, endpoint):
    40          """ Returns the link endpoint that is not the one given """
    41          raise NotImplementedError
    42
    43 -    def getDataForJSON(self):
    44          """ Returns data ready for serialization.
    45              Format:
    46                  [ id link as string
    47                  , endpoint a name
    48                  , endpoint b name
    49                  , self.OSI_layer
    50                  , self.link_type
    51                  , self.entry_type
    52                  , self.id
    53                  ]
    54          """
    55          raise NotImplementedError
    56
    57 -    def getGeomapData(self, context, full=False):
    58          """ Return the addresses of the endpoints
    59              aggregated for the generation of the context
    60          """
    61          raise NotImplementedError
    62
    63  # DEPRECATED - This class will be removed in the next release. It's here now
    64  # only so that relations won't totally break for no reason.
    65 -class Link(ZenModelRM):
    66      _relations = (
    67          ("endpoints", ToMany(
    68           ToMany, "Products.ZenModel.OSComponent", "links")),
    69      )
    70