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

# Source Code for Module Products.ZenModel.Link

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