Package gavo :: Package protocols :: Module datalink :: Class DatalinkCore
[frames] | no frames]

Class DatalinkCore

source code

                   object --+                    
                            |                    
 base.structure.StructureBase --+                
                                |                
                   object --+   |                
                            |   |                
           base.common.Parser --+                
                                |                
base.structure.ParseableStructure --+            
                                    |            
             base.structure.Structure --+        
                                        |        
                           svcs.core.Core --+    
                                            |    
                               object --+   |    
                                        |   |    
           base.macros.ExpansionDelegator --+    
                                            |    
                             DatalinkCoreBase --+
                                                |
                                               DatalinkCore

A core for processing datalink and processed data requests.

The input table of this core is dynamically generated from its metaMakers; it makes no sense at all to try and override it.

See `Datalink and SODA`_ for more information.

In contrast to "normal" cores, one of these is made (and destroyed) for each datalink request coming in. This is because the interface of a datalink service depends on the request's value(s) of ID.

The datalink core can produce both its own metadata and data generated. It is the renderer's job to tell them apart.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
adaptForDescriptors(self, renderer, descriptors)
returns a core for renderer and a sequence of ProductDescriptors.
source code
 
adaptForRenderer(self, renderer)
returns a core for a specific product.
source code
 
runForMeta(self, service, inputTable, queryMeta)
returns a rendered VOTable containing the datalinks.
source code
 
runForData(self, service, inputTable, queryMeta)
returns a data set processed according to inputTable's parameters.
source code
 
finalize(self)
breaks circular references to make the garbage collector's job easier.
source code
 
clearProperty(self, name) source code
 
getFullId(self) source code
 
getProperty(self, name, default=<Undefined>) source code
 
hasProperty(self, name) source code
 
setProperty(self, name, value) source code

Inherited from DatalinkCoreBase: completeElement, getDatalinksResource, getMetaForDescriptor

Inherited from svcs.core.Core: __init__, __repr__, __str__, initialize, makeUserDoc, run

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, finishElement, onElementComplete, validate

Inherited from base.structure.ParseableStructure: end_, feed, feedFrom, feedObject, getAttribute, iterEvents, start_, value_

Inherited from base.structure.StructureBase: __providedBy__, adopt, breakCircles, change, copy, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from base.common.Parser: feedEvent

Inherited from base.macros.ExpansionDelegator: expand

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

Class Methods

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'datalinkCore'
a sentinel for all kinds of undefined values.
  datalinkType = 'application/x-votable+xml;content=datalink'
  datalinkAdaptingRenderers = frozenset(['dlasync', 'dlget', 'dl...

Inherited from DatalinkCoreBase: attrSeq, managedAttrs, rejectExtras

Inherited from svcs.core.Core: inputTableXML, outputTableXML

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties
  rd

Inherited from object: __class__

Method Details

adaptForDescriptors(self, renderer, descriptors)

source code 

returns a core for renderer and a sequence of ProductDescriptors.

This method is mainly for helping adaptForRenderer. Do read the docstring there.

adaptForRenderer(self, renderer)

source code 

returns a core for a specific product.

The ugly thing about datalink in DaCHS' architecture is that its interface (in terms of, e.g., inputKeys' values children) depends on the arguments themselves, specifically the pubDID.

The workaround is to abuse the renderer-specific getCoreFor, ignore the renderer and instead steal an "args" variable from somewhere upstack. Nasty, but for now an acceptable solution.

It is particularly important to never let service cache the cores returned for the dl* renderers; hence to "nocache" magic.

This tries to generate all datalink-relevant metadata in one go and avoid calling the descriptorGenerator(s) more than once per pubDID. It therefore adds datalinkLinks, datalinkEndpoints, and datalinkDescriptors attributes. These are used later in either metadata generation or data processing.

The latter will in general use only the last pubDID passed in. Therefore, this last pubDID determines the service interface for now. Perhaps we should be joining the inputKeys in some way, though, e.g., if we want to allow retrieving multiple datasets in a tar file? Or to re-use the same service for all pubdids?

Overrides: svcs.core.Core.adaptForRenderer

finalize(self)

source code 

breaks circular references to make the garbage collector's job easier.

The core will no longer function once this has been called.

clearProperty(self, name)

source code 
Overrides: svcs.core.Core.clearProperty

getFullId(self)

source code 
Overrides: svcs.core.Core.getFullId

getProperty(self, name, default=<Undefined>)

source code 
Overrides: svcs.core.Core.getProperty

hasProperty(self, name)

source code 
Overrides: svcs.core.Core.hasProperty

setProperty(self, name, value)

source code 
Overrides: svcs.core.Core.setProperty

Class Variable Details

datalinkAdaptingRenderers

Value:
frozenset(['dlasync', 'dlget', 'dlmeta', 'form', 'ssap.xml'])

Property Details

rd

Get Method:
unreachable._getRD(self)