Package flumotion :: Package common :: Module interfaces
[hide private]

Source Code for Module flumotion.common.interfaces

  1  # -*- Mode: Python -*- 
  2  # vi:si:et:sw=4:sts=4:ts=4 
  3  # 
  4  # Flumotion - a streaming media server 
  5  # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). 
  6  # All rights reserved. 
  7   
  8  # This file may be distributed and/or modified under the terms of 
  9  # the GNU General Public License version 2 as published by 
 10  # the Free Software Foundation. 
 11  # This file is distributed without any warranty; without even the implied 
 12  # warranty of merchantability or fitness for a particular purpose. 
 13  # See "LICENSE.GPL" in the source distribution for more information. 
 14   
 15  # Licensees having purchased or holding a valid Flumotion Advanced 
 16  # Streaming Server license may use this file in accordance with the 
 17  # Flumotion Advanced Streaming Server Commercial License Agreement. 
 18  # See "LICENSE.Flumotion" in the source distribution for more information. 
 19   
 20  # Headers in this file shall remain intact. 
 21   
 22  """ 
 23  Flumotion interfaces 
 24  """ 
 25   
 26  from flumotion.twisted import compat 
 27   
 28  # See also flumotion.medium.BaseMedium. 
29 -class IMedium(compat.Interface):
30 """ 31 I am a base interface for PB client-side mediums interfacing with 32 manager-side avatars. 33 """ 34
35 - def setRemoteReference(self, remoteReference):
36 """ 37 Set the RemoteReference to the manager-side avatar. 38 39 @param remoteReference: L{twisted.spread.pb.RemoteReference} 40 """
41
42 - def hasRemoteReference(self):
43 """ 44 Check if we have a remote reference to the PB server's avatar. 45 46 @returns: True if we have a remote reference 47 """
48
49 - def callRemote(self, name, *args, **kwargs):
50 """ 51 Call a method through the remote reference to the manager-side avatar. 52 """
53
54 -class IComponentMedium(IMedium):
55 """ 56 I am an interface for component-side mediums interfacing with server-side 57 avatars. 58 """ 59 pass
60
61 -class IStreamingComponent(compat.Interface):
62 """ 63 An interface for streaming components, for plugs that require a streaming 64 component of some sort to use. 65 """
66 - def getUrl(self):
67 """ 68 Return a URL that the streaming component is streaming. 69 """
70
71 - def getDescription(self):
72 """ 73 Return a description of the stream from this component. 74 """
75
76 -class IAdminMedium(IMedium):
77 """ 78 I am an interface for admin-side mediums interfacing with manager-side 79 avatars. 80 """ 81 pass
82
83 -class IWorkerMedium(IMedium):
84 """ 85 I am an interface for worker-side mediums interfacing with manager-side 86 avatars. 87 """ 88 pass
89
90 -class IPorterMedium(IMedium):
91 """ 92 I am an interface for porter client mediums interfacing with the porter. 93 """ 94 pass
95
96 -class IJobMedium(IMedium):
97 """ 98 I am an interface for job-side mediums interfacing with worker-side 99 avatars. 100 """ 101 pass
102
103 -class IFeedMedium(IMedium):
104 """ 105 I am an interface for mediums in a job or manager interfacing with feed 106 avatars. 107 """ 108 pass
109
110 -class IHeaven(compat.Interface):
111 """ 112 My implementors manage avatars logging in to the manager. 113 """
114 - def createAvatar(self, avatarId):
115 """ 116 Creates a new avatar matching the type of heaven. 117 118 @type avatarId: string 119 120 @returns: the avatar from the matching heaven for a new object. 121 """
122
123 - def removeAvatar(self, avatarId):
124 """ 125 Remove the avatar with the given Id from the heaven. 126 """
127
128 -class IFeedServerParent(compat.Interface):
129 """ 130 I am an interface for objects that manage a FeedServer, allowing the 131 FeedServer to hand off file descriptors to eaters and feeders managed 132 by the parent. 133 """
134 - def feedToFD(self, componentId, feedName, fd):
135 """ 136 Make the component feed the given feed to the fd. 137 """
138