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:
- addPar(value, job) -> None -- parse value and perform some action
- (typically, set an attribute) on job. The default implementation
puts a value into the parameters dictionary _deserialized.
- getPar(job) -> string -- infer a string representation of the
- job parameter on job. The default implementation gets
the value from the parameter from the parameters dictionary and
_serializes it.
- _deserialize(str) -> val -- turns something from an XML tree
into a python value as usable by the worker
- _serialize(val) -> str -- yields some XML-embeddable serialization
of val
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)
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__init__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
updatePar(cls,
name,
value,
job)
Class Method
| source code
|
enters name:value into job's parameter dict.
See the uws.JobParameter's docstring.
|