Package flumotion :: Package component :: Module feed :: Class FeedMedium
[hide private]

Class FeedMedium

source code

 twisted.spread.jelly.Jellyable --+            
                                  |            
twisted.spread.flavors.Serializable --+        
                                      |        
   twisted.spread.flavors.Referenceable --+    
                                          |    
                extern.log.log.Loggable --+    
                                          |    
                   twisted.pb.Referenceable --+
                                              |
                                             FeedMedium

I am a client for a Feed Server.

I am used as the remote interface between a component and another component.

Instance Methods [hide private]
 
__init__(self, logName=None) source code
 
startConnecting(self, host, port, authenticator, timeout=30, bindAddress=None)
Optional helper method to connect to a remote feed server.
source code
 
requestFeed(self, host, port, authenticator, fullFeedId)
Request a feed from a remote feed server.
source code
 
sendFeed(self, host, port, authenticator, fullFeedId)
Send a feed to a remote feed server.
source code
 
stopConnecting(self)
Stop a pending or established connection made via startConnecting().
source code
 
setRemoteReference(self, remoteReference) source code
 
hasRemoteReference(self) source code
 
callRemote(self, name, *args, **kwargs) source code
 
remote_sendFeedReply(self, fullFeedId) source code
 
_doFeedTo(self, fullFeedId, t) source code

Inherited from twisted.pb.Referenceable: remoteMessageReceived

Inherited from twisted.spread.flavors.Referenceable: jellyFor

Inherited from twisted.spread.flavors.Serializable: processUniqueID

Inherited from twisted.spread.jelly.Jellyable: __providedBy__, getStateFor

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]
  logCategory = 'feedmedium'
Implementors can provide a category to log their messages under.
str remoteLogName = 'feedserver'
name to use to log the other side of the connection
  __implemented__ = <implementedBy flumotion.component.feed.Feed...
  __provides__ = <zope.interface.declarations.ClassProvides obje...

Inherited from twisted.spread.flavors.Referenceable: perspective

Instance Variables [hide private]
twisted.spread.pb.RemoteReference remote = None
a reference to a flumotion.worker.feedserver.FeedAvatar
flumotion.component.feedcomponent.FeedComponent component
the component this is a feed client for
Method Details [hide private]

startConnecting(self, host, port, authenticator, timeout=30, bindAddress=None)

source code 

Optional helper method to connect to a remote feed server.

This method starts a client factory connecting via a PassableClientConnector. It offers the possibility of cancelling an in-progress connection via the stopConnecting() method.

Parameters:
  • host (str) - the remote host name
  • port - the tcp port on which to connect @param port int
  • authenticator (flumotion.twisted.pb.Authenticator) - the authenticator, normally provided by the worker
Returns:
a deferred that will fire with the remote reference, once we have authenticated.

requestFeed(self, host, port, authenticator, fullFeedId)

source code 

Request a feed from a remote feed server.

This helper method calls startConnecting() to make the connection and authenticate, and will return the feed file descriptor or an error. A pending connection attempt can be cancelled via stopConnecting().

Parameters:
  • host (str) - the remote host name
  • port (int) - the tcp port on which to connect
  • authenticator (flumotion.twisted.pb.Authenticator) - the authenticator, normally provided by the worker
  • fullFeedId (str) - the full feed id (/flow/component:feed) offered by the remote side
Returns:
a deferred that, if successful, will fire with a pair (feedId, fd). In an error case it will errback and close the remote connection.

sendFeed(self, host, port, authenticator, fullFeedId)

source code 

Send a feed to a remote feed server.

This helper method calls startConnecting() to make the connection and authenticate, and will return the feed file descriptor or an error. A pending connection attempt can be cancelled via stopConnecting().

Parameters:
  • host (str) - the remote host name
  • port (int) - the tcp port on which to connect
  • authenticator (flumotion.twisted.pb.Authenticator) - the authenticator, normally provided by the worker
  • fullFeedId (str) - the full feed id (/flow/component:eaterAlias) to feed to on the remote size
Returns:
a deferred that, if successful, will fire with a pair (feedId, fd). In an error case it will errback and close the remote connection.

stopConnecting(self)

source code 

Stop a pending or established connection made via startConnecting().

Stops any established or pending connection to a remote feed server started via the startConnecting() method. Safe to call even if connection has not been started.


Class Variable Details [hide private]

__implemented__

Value:
<implementedBy flumotion.component.feed.FeedMedium>

__provides__

Value:
<zope.interface.declarations.ClassProvides object at 0x99c4eac>