Package flumotion :: Package admin :: Package assistant :: Module interfaces
[hide private]

Source Code for Module flumotion.admin.assistant.interfaces

  1  # -*- Mode: Python -*- 
  2  # vi:si:et:sw=4:sts=4:ts=4 
  3  # 
  4  # Flumotion - a streaming media server 
  5  # Copyright (C) 2008 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  """Flumotion interfaces used by the configuration assistant 
 23  """ 
 24   
 25  from zope.interface import Interface 
 26   
 27  __version__ = "$Rev$" 
 28   
 29   
30 -class IProducerPlugin(Interface):
31 """A producer plugin is how you extend the production assistant page. 32 The main purpose of the plugin is to get a assistant step specific 33 to the plugin. 34 This entry point should be defined in the xml for the component 35 under the entry type "wizard". 36 """ 37
38 - def __call__(assistant):
39 """Creates producer plugins 40 @param assistant: the assistant 41 @type assistant: L{ConfigurationAssistant} 42 """
43
44 - def getProductionStep(type):
45 """Asks the plugin for a step. 46 type is the kind of plugin, it's useful for components such as 47 firewire for which you can point both audio and video to the 48 same plugin. 49 @param type: audio or video 50 @type type: string 51 @returns: the assistant step 52 @rtype: a L{WorkerWizardStep} subclass 53 """
54 55
56 -class IEncoderPlugin(Interface):
57 """An encoder plugin is how you extend the encoding assistant page. 58 The main purpose of the plugin is to get a assistant step specific 59 to the plugin. 60 This entry point should be defined in the xml for the component 61 under the entry type "wizard". 62 """ 63
64 - def __call__(assistant):
65 """Creates encoder plugins 66 @param assistant: the assistant 67 @type assistant: L{ConfigurationAssistant} 68 """
69
70 - def getConversionStep():
71 """Asks the plugin for a step. 72 @returns: the assistant step 73 @rtype: a L{WorkerWizardStep} subclass 74 """
75 76
77 -class IConsumerPlugin(Interface):
78 """A consumer plugin is how you extend the production assistant page. 79 The main purpose of the plugin is to get a assistant step specific 80 to the plugin. 81 This entry point should be defined in the xml for the component 82 under the entry type "wizard". 83 """ 84
85 - def __call__(assistant):
86 """Creates producer plugins 87 @param assistant: the assistant 88 @type assistant: L{ConfigurationAssistant} 89 """
90
91 - def getConsumptionStep(type):
92 """Asks the plugin for a step. 93 type is the kind of plugin. 94 @param type: audio or video or audio-video 95 @type type: string 96 @returns: the assistant step 97 @rtype: a L{WorkerWizardStep} subclass 98 """
99 100
101 -class IHTTPConsumerPlugin(Interface):
102 """A http consumer plugin is how you extend the HTTP consumer page. 103 The main purpose of the plugin is to get a consumer model 104 (eg, a http server) specific for this plugin. 105 This entry point should be defined in the xml for the component 106 under the entry type "wizard". 107 """ 108
109 - def __call__(assistant, model):
110 """Creates http consumer plugins 111 @param assistant: the assistant 112 @type assistant: L{ConfigurationAssistant} 113 """
114
115 - def workerChanged(worker):
116 """Called when the worker for the step changed. 117 @param worker: the worker 118 @type worker: L{WorkerComponentUIState} 119 """
120
121 - def getPlugWizard(description):
122 """Creates a plugin line for the consumer 123 @param description: The text to appear in the line 124 @type description: str 125 @returns: wizard plugin line 126 @rtype: a L{WizardPlugLine} 127 """
128 129
130 -class IHTTPConsumerPluginLine(Interface):
131
132 - def getConsumer(streamer, audio_producer, video_producer):
133 """Asks the plugin line for a consumer model 134 @param streamer: the http streamer 135 @type streamer: L{HTTPStreamer} subclass 136 @param audio_producer: audio producer for this stream 137 @type audio_producer: L{AudioProducer} subclass 138 @param video_producer: video producer for this stream 139 @type video_producer: L{VideoProducer} subclass 140 @returns: consumer 141 @rtype: a L{HTTPServer} subclass 142 """
143 144
145 -class IHTTPServerPlugin(Interface):
146 """A http server plugin allows to extend a HTTP server. 147 The main purpose of the plugin is to get a wizard plug line that can be 148 added into a plug area. The plugline should add/delete the plug from the 149 http server model when activated/deactivated. 150 This entry point should be defined in the xml for the plug 151 under the entry type "wizard". 152 """ 153
154 - def __call__(assistant, component):
155 """Creates http server plugins 156 @param assistant: the assistant 157 @type assistant: L{ConfigurationAssistant} 158 @param component: the component that will receive the plug 159 @type assistant: L{f.a.a.m.Component} 160 """
161
162 - def workerChanged(worker):
163 """Called when the worker for the step changed. 164 @param worker: the worker 165 @type worker: str 166 """
167
168 - def getPlugWizard(description):
169 """Creates a plugin line for the consumer 170 @param description: The text to appear in the line 171 @type description: str 172 @returns: wizard plugin line 173 @rtype: a L{WizardPlugLine} 174 """
175 176
177 -class IScenarioAssistantPlugin(Interface):
178 """A pluggable scenario that can be listed at the first page of the wizard. 179 It predefines the steps the wizard will take and the way it is saved. 180 """ 181
182 - def addSteps(assistant):
183 """Called to add the required steps to the wizard. 184 @param assistant: The assistant the steps have to be added to. 185 @type assistant: L{ConfigurationAssistant} 186 """
187
188 - def save(assistant, saver):
189 """Saves the scenario through an AdminSaver to get the configuration. 190 @param assistant: The assistant the steps have to be added to. 191 @type assistant: L{ConfigurationAssistant} 192 @param saver: The element which generates the xml configuration. 193 @type saver: L{AssistantSaver} 194 """
195