Package Products :: Package ZenUtils :: Package guid :: Module interfaces |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenUtils.guid.interfaces

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2010, 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 or (at your
     8  # option) any later version as published by the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13  from zope.interface import Interface, Attribute
    14  from zope.component.interfaces import IObjectEvent
    15
    16
    17 -class IGloballyIdentifiable(Interface):
    18      """
    19      An object with a GUID.
    20      """
    21 -    def getPrimaryUrlPath():
    22          """
    23          The path under which the object can be found.
    24          """
    25
    26
    27 -class IGlobalIdentifier(Interface):
    28      """
    29      Adapter that manages GUID for objects.
    30      """
    31 -    def __init__(context):
    32          """
    33          Constructor
    34          """
    35
    36      guid = Attribute("Globally unique identifier")
    37
    38 -    def getGUID():
    39          """
    40          Gets the GUID associated with this object.
    41          """
    42 -    def setGUID(value):
    43          """
    44          Sets the GUID for this object.
    45          """
    46 -    def create(force):
    47          """
    48          Creates a new GUID and applies it to this object.
    49          """
    50
    51 -class IGUIDManager(Interface):
    52      """
    53      A utility that can register objects as having guids and look up objects by
    54      guid.
    55      """
    56 -    def getPath(guid):
    57          """
    58          Return the path associated with a guid.
    59          """
    60 -    def getObject(guid):
    61          """
    62          Return the object associated with a guid.
    63          """
    64 -    def register(object):
    65          """
    66          Store the guid-path mapping in the reference table.
    67          """
    68
    69 -class IGUIDEvent(IObjectEvent):
    70      pass
    71