Package gavo :: Package protocols :: Module uws :: Class JobParameter
[frames] | no frames]

Class JobParameter

source code

object --+
         |
        JobParameter
Known Subclasses:

A UWS job parameter.

Job parameters are (normally) elements of a job's parameters dictionary, i.e., usually elements of the job control language. "Magic" parameters that allow automatic serialization or special effects on the job can be defined using the _parameter_name class attributes of UWSJobs. They are employed when using the setSerializedPar and getSerializedPar interface.

All methods of these are class or static methods since ProtocolParameters are never instanciated.

The default value setter enforces a maximum length of 50000 characters for incoming strings. This is a mild shield against accidental DoS with, e.g., bad uploads in TAP.

The serialization thing really belongs to the user-facing interface. However, since it's most convenient to have these parameters in the UWSJob classes, the class is defined here.

Internal clients would read the parameters directly from the dictionary.

Methods you can override:

The default implementation just dumps/gets name from the job's parameters dict. This is the behaviour for non-magic parameters since (get|set)SerializedPar falls back to the base class.

CAUTION: Do not say job.parameters[bla] = "ab" -- your changes will get lost because serialisation of the parameters dictionary must be initiated manually. Always manipulate the parameters dictionary by using cls.updatePar(name, value, job) or a suitable facade (job.setPar, job.setSerializedPar)

Instance Methods

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

Class Methods
 
updatePar(cls, name, value, job)
enters name:value into job's parameter dict.
source code
 
addPar(cls, name, value, job) source code
 
getPar(cls, name, job) source code
Properties

Inherited from object: __class__

Method Details

updatePar(cls, name, value, job)
Class Method

source code 

enters name:value into job's parameter dict.

See the uws.JobParameter's docstring.