Package pyamf :: Package remoting :: Package client :: Class RemotingService
[hide private]
[frames] | no frames]

Class RemotingService

source code


Acts as a client for AMF calls.

Instance Methods [hide private]
 
__init__(self, url, amf_version=0, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_setUrl(self, url) source code
 
setProxy(self, host, type='http')
Set the proxy for all requests to use.
source code
 
addHeader(self, name, value, must_understand=False)
Sets a persistent header to send with each request.
source code
 
addHTTPHeader(self, name, value)
Adds a header to the underlying HTTP connection.
source code
 
removeHTTPHeader(self, name)
Deletes an HTTP header.
source code
ServiceProxy
getService(self, name, auto_execute=True)
Returns a ServiceProxy for the supplied name.
source code
 
getRequest(self, id_)
Gets a request based on the id.
source code
 
addRequest(self, service, *args)
Adds a request to be sent to the remoting gateway.
source code
 
removeRequest(self, service, *args)
Removes a request from the pending request list.
source code
 
getAMFRequest(self, requests)
Builds an AMF request {LEnvelope<pyamf.remoting.Envelope>} from a supplied list of requests.
source code
 
_get_execute_headers(self) source code
 
execute_single(self, request)
Builds, sends and handles the response to a single request, returning the response.
source code
 
execute(self)
Builds, sends and handles the responses to all requests listed in self.requests.
source code
 
_getResponse(self, http_request)
Gets and handles the HTTP response from the remote gateway.
source code
 
setCredentials(self, username, password)
Sets authentication credentials for accessing the remote gateway.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  amf_version
The AMF version to use.
HeaderCollection headers
A list of persistent headers to send with each request.
dict http_headers
A dict of HTTP headers to apply to the underlying HTTP connection.
  opener
The function used to power the connection to the remote server.
string referer
The referer, or HTTP referer, identifies the address of the client.
  request_number
A unique identifier for tracking the number of requests.
list requests
The list of pending requests to process.
  strict
Whether to use strict AMF en/decoding or not.
string url
The url of the remote gateway.
string user_agent
Contains information about the user agent (client) originating the request.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, url, amf_version=0, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setProxy(self, host, type='http')

source code 

Set the proxy for all requests to use.

addHeader(self, name, value, must_understand=False)

source code 

Sets a persistent header to send with each request.

Parameters:
  • name - Header name.

getService(self, name, auto_execute=True)

source code 

Returns a ServiceProxy for the supplied name. Sets up an object that can have method calls made to it that build the AMF requests.

Returns: ServiceProxy

getRequest(self, id_)

source code 

Gets a request based on the id.

:raise LookupError: Request not found.


Instance Variable Details [hide private]

amf_version

The AMF version to use. See ENCODING_TYPES.

opener

The function used to power the connection to the remote server. Defaults to urllib2.urlopen<http:// docs.python.org/library/urllib2.html#urllib2.urlopen.

referer

The referer, or HTTP referer, identifies the address of the client. Ignored by default.
Type:
string

url

The url of the remote gateway. Accepts http or https as valid schemes.
Type:
string

user_agent

Contains information about the user agent (client) originating the request. See DEFAULT_USER_AGENT.
Type:
string