Package occi :: Module handlers :: Class BaseHandler
[hide private]
[frames] | no frames]

Class BaseHandler

source code

object --+
         |
        BaseHandler
Known Subclasses:

General request handler.

Instance Methods [hide private]
 
__init__(self, registry, headers, body, query, extras=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
handle(self, method, key)
Call a HTTP method function on this handler.
source code
 
get_renderer(self, content_type)
Returns the proper rendering parser.
source code
 
response(self, status, headers=None, body='OK')
Will try to figure out what rendering the client wants and return back the given status, header and boy.
source code
 
parse_action(self)
Retrieves the Action which was given in the request.
source code
 
parse_filter(self)
Retrieve any attributes or categories which where provided in the request for filtering.
source code
 
parse_entity(self, def_kind=None)
Retrieves the entity which was rendered within the request.
source code
 
parse_entities(self)
Retrieves a set of entities which was rendered within the request.
source code
 
parse_mixins(self)
Retrieves a mixin from a request.
source code
 
render_entity(self, entity)
Renders a single entity to the client.
source code
 
render_entities(self, entities, key)
Renders a list of entities to the client.
source code
 
render_categories(self, categories)
Renders a list of categories to the client.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, registry, headers, body, query, extras=None)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

handle(self, method, key)

source code 

Call a HTTP method function on this handler. E.g. when method is HTTP GET the function get(key) will be called. If the function is not defined a 405 is returned.

method -- The HTTP method name. key -- The key of the resource.

get_renderer(self, content_type)

source code 

Returns the proper rendering parser.

content_type -- String with either either Content-Type or Accept.

response(self, status, headers=None, body='OK')

source code 

Will try to figure out what rendering the client wants and return back the given status, header and boy.

status -- The status code. headers -- The HTTP headers (default: empty). body -- The text for the body (default: 'ok').

parse_entity(self, def_kind=None)

source code 

Retrieves the entity which was rendered within the request.

def_kind -- Indicates if the request can be incomplete (False).

render_entity(self, entity)

source code 

Renders a single entity to the client.

entity -- The entity which should be rendered.

render_entities(self, entities, key)

source code 

Renders a list of entities to the client.

entities -- The entities which should be rendered.

render_categories(self, categories)

source code 

Renders a list of categories to the client.

categories -- The categories which should be rendered.